I am referring to my comment here: http://drupal.org/node/356009#comment-1978922 posted a while ago but unfortunately did not get any help solving my problem.
Basically I have a node with one ImageField in it, that allows multiple images. I have tried uploading multiple images using both manual method (one-by-one) and also using Image FUpload. The results are slightly different but always similar: after a certain number of images is reached, the upload process breaks. Obviously some limitation of the server is reached but I cannot figure out what. In my example I have: 20 images (approx 8Mb in total size). Resolution is 1600x1200 for all of them. My imagefield is set to 1024x768 max resolution and I also have 2 imagecache presets, so there is certainly some resizing going on.
Here are the parameters set in my host:
:: Memory limit: 96 MB
:: max_execution_time: 45 sec
:: upload_max_filesize: 24 MB
:: post_max_size: 32 MB
These numbers are not huge but should be more than enough to handle my 20 small images from the example above. That is the part that I don't understand: why are these numbers not enough? Also I am using shared hosting and I don't have the ability to play with the server parameters. Moving to a dedicated hosting is not an option as it is 5-6 times more expensive, which cannot be justified in my case (early development stage, non-profit web site).
So I am looking for a solution coming from the software used: I need to understand how ImageField works and how does it handle multiple images. Can you help me with some ideas regarding this and also why the above parameters are not enough for my simple test?
Thanks!
Comments
Comment #1
quicksketchThis sounds like a textbook case of Suhosin messing with you. See the FileField FAQ: http://drupal.org/node/423478. You may be able to disable Suhosin through a custom php.ini, but you will probably need to move to a different host (it doesn't have to be dedicated) that doesn't have this terrible extension installed.
Comment #2
kirilius commentedI looked at my PHP report but the word "Suhosin" is not found anywhere on that page. Is that sufficient to say that I don't have that extension or should I look for another string?
Comment #3
quicksketchHmm, sometime the admin/reports/status/php page does not show all extensions. Could you try by making a new php file with just
<?php phpinfo(); ?>in it?Comment #4
kirilius commentedSame thing. The page generated by
<?php phpinfo(); ?>does not contain the Suhosin string.Comment #5
quicksketchHm, I'm at a loss then. There's no reason in the FileField code why you would be restricted to any number of files. It should be able to handle as many as you can throw at it (provided you have enough memory). I've seen 150+ files attached to a single node before (not that I'd recommend that).
Comment #6
kirilius commentedI am sure FileField can handle multiple files. What I am concerned about is how they are uploaded, i.e. if you sequentially add 10 images to an imagefield, one by one and hit Save at the end, how many POST requests will that result in? Will there be 10 smaller requests - one for each upload and one small for the Save or everything (combined image sizes) will be submitted at the end?
Comment #7
quicksketchIf you click the "Upload" button between each file, then the file will already be on the server, allowing you to upload as many 24MB images as you want. However if you do not click "Upload" and just populate 10 file fields, then the click "Save" without uploading, you will be limited to the total size of all the files put together because they will all need to be transferred at the same time.
Comment #8
kirilius commentedIs that the case? I hit the save button at the end but every time I hit "Add another item", the last image is uploaded and a thumbnail generated. So I suspect that acts as if I clicked Upload after selecting each file.
Comment #9
quicksketchOh yes clicking "Add another item" also submits and files that have been selected. Basically any time you click any button it's going to add up all the file fields that are currently on the page and submit them all at once.
Comment #10
quicksketch