Should HTML have a “max file size” attribute for input type=file?
discourse.specifiction.org
discourse.specifiction.org
For file size there is no interface that shows you what your limit or acceptable range is. In this case how do you notify the user they're trying to upload more than they should? Do we then tie modals / messages to the file input to handle the cases where a user selects something too big?
At least right now you can handle all of this via JavaScript. I think that may make sense to continue versus adding additional attributes.
With CORS and CSRF tokens, it would cut down on accidental issues – which for most sites is a bigger deal than malicious activity.
You just know some less-than-stellar web developer is going to use it and not use any proper server-side validation.