using:
Content Construction Kit (CCK) 6.x-2.1
ImageField 6.x-3.0-alpha4
public files

field is configured as unlimited, listed by default, description disabled.

the first 24 images work just fine, but after that, when you upload another file on the edit page, the image doesn't appear and if you you save, no additional images are uploaded.

no errors are reported.

i can upload additional images to another node, so it's not as if some limit has been reached on the server.

Comments

gutomec’s picture

Same problem for me!!! Help please!!!
http://www.oficinadobiscuit.com.br in field imagem. Limmits to 23 images uploads.

gutomec’s picture

Any body help?

klapper’s picture

If you got an "mod_fcgid: stderr: ALERT - configured fileupload limit exceeded - file dropped" in your error log, you might try changing your upload limits: http://drupal.org/node/127417

But, that didn't help me - i'm stuck with 10 images.

klapper’s picture

As mentioned before, i have the same problem with 10 images (the 11th wont load up). I did change my memory limits (memory_limit, upload_max_filesize, post_max_size) and it didnt help. I have several nodes with different sets of images with different sizes. And none will accept an 11th 1-kb-image.

But i have a workaround: if you are on the edit page, go to free upload field (new upload) and shift it up to a position within the first 10 using the weight-cross. On such a position it works as expected.

Maybe that helps a CCK specialist to get the right idea.

gutomec’s picture

suhosin.upload.max_uploads = 25. Is it the problem?

thx

klapper’s picture

The following settings didn't help (set in htaccess and verified with phpinfo):

php_value memory_limit 32M
php_value post_max_size 32M
php_value upload_max_filesize 32M
php_value suhosin.upload.max_uploads 100
php_value suhosin.post.max_vars 1000
php_value suhosin.request.max_vars 1000
php_value suhosin.memory_limit 32M
php_value suhosin.get.max_value_length 1024

I can do more uploads with the workaround described above, so it should be related to Drupal.

quicksketch’s picture

Project: ImageField » FileField
Version: 6.x-3.0-alpha4 » 6.x-3.x-dev

The root of this problem must be in FileField somewhere, since the same problem applies to it as well. I'm moving over to that queue.

My guess on this (and really just a guess): maybe we're running into a problem with CCK's weight field? The weight field is usually hidden from display unless you turn off JavaScript, but it's what stores the order of the files when you drag and drop them up and down. As far as I know, CCK gives you a weight field of -10 to 10, which would really mean 21 uploads rather than 24, but it's a possibility.

szy’s picture

As I have written in my double issues (forgive me), my max number of uploaded files
is 40...

@gutomec, @klaber, @blb: do you get 'Access Denied' alert when saving a node?

Szy.

szy’s picture

Nothing has changed with the beta1 release :/

Szy.

szy’s picture

After clearing the cache during testing, I got:

warning: Missing argument 2 for content_add_more_js() in /modules/cck/includes/content.node_form.inc on line 271.
warning: Missing argument 2 for content_add_more_js() in /modules/cck/includes/content.node_form.inc on line 271.

Maybe this will help you?

Szy.

szy’s picture

Title: uploads in unlimited field stop working after 24 images » Suhosin PHP extension causes upload failure in unlimited field
Category: bug » support

Looks like I've found a solution! :]

Check your PHP status at your-drupal/admin/reports/status/php - is there a Suhosin
(PHP security extension) section?

Find these variables:

suhosin.cookie.max_vars 100 100
suhosin.get.max_vars 100 100
suhosin.post.max_vars 200 200
suhosin.request.max_vars 200 200

Numbers above come from my config - what are yours? They need to be much higher
to upload tens or hundreds of files.

We all have different values set there, that's why our upload limits were different.

I changed my config to:

suhosin.post.max_vars = 200000
suhosin.request.max_vars = 20000
suhosin.post.max_value_length = 265000
suhosin.request.max_value_length = 265000

... and I can't see any problem with uploading files to unlimited field.

Ask your hostmaster for a change, or do it yourself in appropriate PHP config file.
I keep my fingers crossed... :]

Related:

-> #122383: PHP Suhosin extension causes spontaneous log outs with Drupal 5.1
-> #187677: Is there a length limit to the text in a CCK text field?

Szy.

eigentor’s picture

Raising these limits did not help me.
I can upload extactly 25 images, and these Variables are set for me like the following: (local value, master value is lower)

suhosin.post.max_vars = 6144
suhosin.request.max_vars = 6144
suhosin.post.max_value_length = 195000
suhosin.request.max_value_length = 195000

Wile suhosin.upload.max_uploads = 25.
This is how I found this thread via Google at all.

quicksketch’s picture

Updating to the new CCK (2.2) might also be worth a shot, as it fixes a few other issues with FileField.

szy’s picture

Significant to me was the fact of logging out from Drupal during file upload. And beacuse
I haven't found anything about such a misbehaviour of Filefield or related modules, I was
looking for out-of-Drupal reason.

@eigentor:

Are you logged out after upload? Have you changed suhosin.upload.max_uploads value?
Have you tried bigger than 6144 values? Have you changed your regular PHP 'max' limits?

Szy.

eigentor’s picture

Found it - for me.

Well for me clearly the
suhosin.upload.max_uploads
is the culprit.

I was able to reproduce it on another server that has also suhosin installed.
Whatever number is entered for suhosin.upload.max_uploads limits the uploads
to exactly that number.

The other variables szy mentioned did not have much influence
for me - on the mentioned other server they were on a quite low setting.

So I guess fixing that problem should look into what suhosin.upload.max_uploads
exactly does and trying to fix this.

quicksketch’s picture

Wow, szy I don't know how you're finding the exact causes of all these problems. But I can just say, Thank You!

What host are you guys using? It might be helpful to warn users in the future. Most users probably don't know if their host is using Suhosin or not.

Here's the docs that I could find on Suhosin, looks like a 3rd party extension to PHP: http://www.hardened-php.net/suhosin/configuration.html#suhosin.upload.ma...

Thanks again for finding this one! When the contrib handbook gets in order again I'll put this in the FAQ.

szy’s picture

@quicksketch:

Wow, quicksketch I don't know how you're developing all this Drupal staff.
But I can just say, Thank You!

... that's what Drupal is all about! :)))

@eigentor:

I still have suhosin.upload.max_uploads set to 25, however now I'm uploading
60-70 files with one 'Save' click! :]

Weird, but lucky we - it works now.

Szy.

eigentor’s picture

Still haven't found...

While this issue is blurred by different suhosin settings solving the problem, a fix is needed. For me also the workaround from #4 worked, but this is nothing you can ask a client to do, especially when he wants to upload 80+ images. #4 also affects the order of the uploaded images.

But it is a hint that indeed the weight system or some funny counting is the problem, not the fact how many images are in a node.

I had the problem with using hosting Provider "hosteurope" and could reproduce it on a vserver running debian etch that has suhosin installed with default configuration.

For the client that is affected we may be forced to switch hosting providers as hosteurope does not allow to change suhosin.upload.max_uploads for security reasons. They would have to allow it for many people and don't want to do that.

I don't know how many hosting providers are using Suhosin, but it will be quite a few. The changing of settings via .htaccess is not always allowed and a guess and hit and miss game. Some bughunting in filefield and investigation what Suhosin exactly does - namely suhosin.upload.max_uploads is needed.

When one googles for "suhosin batch upload" one finds quite a few posts, mostly in the coppermine forum mentioning the problem. Just like here different variable settings are recommended to solve it. Obviously the multivalue option on filefield is handled like a batch upload - as if you would upload all the files at once. Maybe there is a way to change that. (though I wonder how - with all the files being in one array)

klapper’s picture

Title: Suhosin PHP extension causes upload failure in unlimited field » uploads in unlimited field stop working after x images
Category: support » bug

I agree with eigentor - there is some programming, that causes problems. Maybe its related to suhosin, but Drupal should address the settings on most hosts. Changing the settings didnt help me either, but the workaround in #4, which shows it can be solved in CCK.

I have changed the title back, so this thread can be found by the symptons, not by a (limited) solution.

quicksketch’s picture

klapper, the problem you describe sounds like one that is fixed by the 2.2 version of CCK. Prior versions weren't incrementing the weight field when adding new fields, so you had to reorder them once to get them to increment properly.

quicksketch’s picture

Status: Active » Fixed

I wrote up a handbook page on fixing Suhosin settings. http://drupal.org/node/423478

klapper, if you're still limited after changing the Suhosin settings and need to use the work around you described in #4, please reopen. I'm pretty sure there was a weight problem in CCK 2.1, which would explain why that workaround worked.

eigentor’s picture

Well, I'll be polite and not reopen.

But alas - CCK 2.2 does not fix it as far as my test goes. CCK 2.2 - suhosin_max_uploads to 25 - no luck. CCK 2.2 - suhosin_max_uploads on a setting higher than the actual image count - no problem.

Not everyone will be allowed to change all Suhosin settings.
So weight indeed appears to have to do with the issue, but the problem still has to be found.
Kudos though for updating the handbook page.

quicksketch’s picture

suhosin_max_uploads on a setting higher than the actual image count - no problem.

I wasn't saying that CCK 2.2 alone would fix the problem. I was meaning that your work-around from #4 (rearrange the items) should not provide any additional benefit when using CCK 2.2.

I think the main problem here is Suhosin. If users aren't allowed to change this setting they should probably seek out different hosting (really at $4/mo investment that's not asking too much, especially since Suhosin is most likely to be installed on shared hosts), preferably one that doesn't have Suhosin at all.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

egifford’s picture

subscribing