File Uploads
A file upload is a special case of getting form input. Half of the story 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 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 file system 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access