开发者

html image file upload failing silently

开发者 https://www.devze.com 2023-01-16 17:33 出处:网络
I have a form where users can enter multiple images to upload along with a bunch of other information. It looks like there is some condition that is causing the last few images not to upload, for some

I have a form where users can enter multiple images to upload along with a bunch of other information. It looks like there is some condition that is causing the last few images not to upload, for some cases. For example, testing the form when uploading about 5 images, they all upload fine. When there are more, somewhere between 10 and 20-some, and this number does vary, then the last few may not upload. I've printed out the $_FILES array, and the selected images don't appear at all. So it looks like they aren't even being sent.

These images are quite small, only about 10-40k. My upload_max_filesize is 2M, and post_max_size is 8M, so that can't be it. Not only that, but these same images still fail to upload when the previous ones in the form are not uploaded - if you leave the first 20 file inputs blank, and select something for the 21st, that image still doesn't upload. And this has been tested with multiple images, so there isn't something wrong with the image file. Note - there aren't exactly 21 file inputs - it's variable, the user can add more or delete some.

I've also tested multiple bro开发者_Python百科wsers, and multiple computers. The only thing is that this problem happens only on my production server and has never occurred on my development server, so that could be a clue. It's also always the inputs at the end of the form, sometimes the last one, sometimes several, depending upon the form inputs being tested.

Is there any inherent limit to the number of file inputs you can have in a single form? I haven't pinpointed an exact number that causes the issue.


http://www.php.net/manual/en/ini.core.php

max_file_uploads 20 PHP_INI_SYSTEM Available since PHP 5.2.12.


Could be max_execution_time for the receiving function. I think the default is often 30 seconds, and perhaps a large upload is taking longer than that?

If your dev server is localhost, that could be quite speedy and not have surfaced the issue until a true remote server was used?

0

精彩评论

暂无评论...
验证码 换一张
取 消