If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

MAX_FILE_SIZE Upload feature not supported




HTML: Form Submission
12 years ago
12 years ago


(Reporter: recover89, Unassigned)



Firefox Tracking Flags

(Not tracked)




12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

The standard MAX_FILE_SIZE upload feature isn't supported in firefox.
It saves you and everyone who uses your homepage a great deal of trouble if the
browser would report if the file is too large and don't upload it!
I quote from the PHP Manual: (php.net/manual/en/features.file-upload.php)
"The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input
field, and its value is the maximum filesize accepted. This is an advisory to
the browser, PHP also checks it. Fooling this setting on the browser side is
quite easy, so never rely on files with a greater size being blocked by this
feature. The PHP settings for maximum-size, however, cannot be fooled. This form
element should always be used as it saves users the trouble of waiting for a big
file being transferred only to find that it was too big and the transfer failed." 
In addition, javascript can't check the filesize itself.

Reproducible: Always

Steps to Reproduce:
1.Create a <input name="MAX_FILE_SIZE" type="hidden" value="1048576" />
2.Try to upload a file above 1MB.
3.Firefox doesn't react that the file is bigger than the MAX_FILE_SIZE value.

Actual Results:  
Firefox tries to upload the file but fails (due to server settings).

Expected Results:  
Alert that the file is in fact bigger than the max allowed filesize.

This is not associated with any extensions or themes.
Assignee: nobody → form-submission
Component: Form Manager → HTML: Form Submission
Product: Firefox → Core
QA Contact: form.manager → ian
Version: unspecified → 1.7 Branch
> The standard MAX_FILE_SIZE upload feature isn't supported in firefox.

After a bit of searching and testing I have to disagree that this is a
/standard/ feature. Opera and IE certainly don't support it. It isn't mentioned
in HTML spec. In fact on searching the only reference I can find to
MAX_FILE_SIZE is in reference to the php manual, or forums with people asking
why they can't get the feature to work.

Comment 2

12 years ago
Still, it would be a good feature.

Comment 3

12 years ago
The extensions to file inputs proposed in Web Forms 2.0 seem more sensible and 
powerful. WONTFIX?

Comment 4

12 years ago
The standard way to do this is using maxlength in the near future:

Mozilla is probably going to support that eventually.
Hardware: PC → All
Version: 1.7 Branch → Trunk
Just to add, looking at
http://uk.php.net/manual/en/features.file-upload.errors.php, it seems php
expects to be able to give you an error code if your file is larger than the
MAX_FILE_SIZE. To me this says that php isnt expecting your browser to not
submit when the file is too big, but rather it's doing the check itself, so this
shouldnt be something we put in the browser.

Comment 6

12 years ago
I set this on WONTFIX because the comments state that it is not a standard and
it will soon be possible to do this with the maxlength attribute.
Thank you for your input. /The person who filed this bug
Last Resolved: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.