O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.8. File Uploads

A file upload is a special case of getting form input. Half of the task is putting together the correct HTML. File uploads are specified in RFC 1867. They are supported by Netscape Navigator 2 and above as well as by Internet Explorer 4 and above. Placing an input tag inside an HTML form with the type attribute set to file causes a text box and a button for browsing the local filesystem to appear on the Web page. Browsers that do not support uploads will likely render this as a text box, so it's best to present uploading forms only to capable browsers. The forms must use the post method to allow for uploads, and they must also contain the enctype attribute with a value of multipart/form-data. A hidden form variable, MAX_FILE_SIZE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required