Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit the allowed file size for <input type=file> in pure HTML (no JS)

Tags:

html

w3c

There are several topics* about setting up a max file size for a input type=file, but there is apparently no pure-standard HTML way to do so (nothing in the HTML spec).

So, is there any pure-HTML way to set a max file size on a input type="file"?

Is there a request for such feature, like a maxsize="..." attribute to let the browser filter out the files the user can selected, or do we have to stick to Javascript File API for years (or ever)?


*Topics:

JS File API: Limit the size of an file upload (html input) or How to check file input size with jQuery?

HTML never-saw-that-in-any-standard: HTML Upload MAX_FILE_SIZE does not appear to work

like image 298
Xenos Avatar asked Feb 12 '16 15:02

Xenos


1 Answers

This is not part of the HTML spec, so there is no "pure HTML" way to do this.

like image 195
Diodeus - James MacFarlane Avatar answered Sep 29 '22 08:09

Diodeus - James MacFarlane