Closed Bug 609594 Opened 15 years ago Closed 14 years ago

openfile limit (ulimit) affects number of files sent using <input type="file" multiple="multiple" >

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jindrich, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7 Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b8pre) Gecko/20101104 Firefox/4.0b8pre on linux, open files limit (ulimit -n) affects number of files sent using html construct <form ... enctype="multipart/form-data"> <input type="file" multiple="multiple" >..... </form Some of files (up to ULIMIT - K, K ~ 80) are sent ok, others are not sent at all (only parameter headers are sent, thus server side believes the files are sent empty. I.E. first N files (up to ULIMIT - K, K ~ 80) are sent correctly like this: -----------------------------654577356272642000772108572 Content-Disposition: form-data; name="uploaded-files"; filename=".JPG" Content-Type: image/jpeg ......JFIF.....H.H......Exif..MM.*......................... file data..... -----------------------------654577356272642000772108572 other files are sent empty like this: -----------------------------654577356272642000772108572 Content-Disposition: form-data; name="uploaded-files"; filename=".JPG" Content-Type: image/jpeg -----------------------------654577356272642000772108572 number of files sent correctly corresponds to number of open files allowed using "ulimit -n" command: ulimit files sent 1024 930 900 820 800 720 700 620 600 520 500 420 400 320 tested on latest firefox night build (firefox-4.0b8pre.en-US.linux-x86_64.tar.bz2) and latest seamonkey build ( seamonkey-2.1b2pre.en-US.linux-x86_64.tar.bz2 Reproducible: Always Steps to Reproduce: 1. create html page with form containing <input type="file" multiple="multiple"> tag, form must be <form ... enctype="multipart/form-data"> 2. populate the page on server and prepare some code to accept the files 3. open the page in firefox, click the "select files" button and select > 1024 files (better some small files) 4. start dumping the communication using e.g. tcpdump -i lo -A -q -t dst port 9090 > dumpfile 5. submit the form in firefox 6. check in dump that the last files content is sent empty Actual Results: not all files content is sent, no error message is displayed, no message is written to the console Expected Results: all files should be sent seems like the file descriptors are kept open during file submitting. It is possible to reproduce the same error next time in the same firefox process, so I assume that the file descriptors are closed once the form is submitted.
> seems like the file descriptors are kept open during file submitting. That's correct. The files are all opened at the beginning of the form submission, then closed one by one as each one is read to EOF. This is absolutely necessary to deal with users deleting the files while the form submission is in progress, for example (which would otherwise cause us to send a malformed HTTP request).
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.