Implementing a file upload under html is fairly simple, but I just noticed that there is an \'accept\' attribute that can be added to the
If the browser uses this attribute, it is only as an help for the user, so he won't upload a multi-megabyte file just to see it rejected by the server...
Same for the tag: if the browser uses it, it won't send the file but an error resulting in
UPLOAD_ERR_FORM_SIZE
(2) error in PHP (not sure how it is handled in other languages).
Note these are helps for the user. Of course, the server must always check the type and size of the file on its end: it is easy to tamper with these values on the client side.