This content originally appeared on Bram.us and was authored by Bramus!
A bit of an older post, but still relevant: Tapas Adhikary goes over some HTML attributes one can set on an input[type="file"]
, and uses of the File API:
- Simple file upload
- Multiple file uploads
- Know about file metadata
- Know about file
accept
property - Manage file content
- Validate file size
- Show file upload progress
- How about directory upload?
- Let’s drag, drop and upload
- Handle files with
objectURL
s
10 useful HTML file upload tips for web developers →
~
Not covered in Tapas’s article is the capture
attribute. Combined with accept
you can have a user on a mobile device immediately take a picture or video:
<!-- Capture photo using the front/selfie camera -->
<input type="file" accept="image/*" capture="user">
<!-- Capture photo using the back camera -->
<input type="file" accept="image/*" capture="environment">
This content originally appeared on Bram.us and was authored by Bramus!

Bramus! | Sciencx (2021-12-13T00:29:43+00:00) 10 useful HTML file upload tips for web developers. Retrieved from https://www.scien.cx/2021/12/13/10-useful-html-file-upload-tips-for-web-developers/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.