I have a Drupal 7 site that uses the Image File Field. When I go to delete an image I get the error message..

An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (6 MB) that this server supports

However, it works fine on my XAMPP installation, but not on my remote server. Also, it appears to be an AJAX issue as when Javascript is disabled, it deletes just fine.

I have a feeling it has something to do with the Suhosin php extension installed on the remote server (my XAMPP does not have this). I have tried increasing the values, for example...

suhosin.request.max_vars = 200000
suhosin.post.max_vars = 200000
suhosin.cookie.encrypt = Off
suhosin.memory_limit = 512M
suhosin.session.encrypt = Off
suhosin.get.max_value_length = 265000

... but I still get the error. I should also add I've tried increasing the normal php.ini values such as upload_max_filesize, max_post_size, and memory limits etc, but that didn't work either.

Any ideas?

Just to add that I get this message appearing in Chrome, but in Firefox I just get a continuous Ajax throbber, no message!

Comments

DaPooch’s picture

I have the same issue and I suspect it's got something to do with PHP 5.3. I migrated my site from a server running PHP 5.2 to a new one with PHP 5.3 and all of a sudden I get this error.

Web Assistant’s picture

Interesting, I actually made another site, with the same functionality and the images delete just fine. Still don't know what the problem is though.

Just to add that I'm using PHP Version 5.2

sunchaser’s picture

I have a related issue.

Have a -node-form.tpl.php that acts as the template for the page that creates a new node of

The page is being built with following syntax for the image upload field:

Please upload an image<br />
<?php print drupal_render_children($form['field_animage']); ?>

Now, when I try to upload an image through that page I get an error stating "I have exceeded ..." (see title of this thread) ...

This problem goes away when I don't use the drupal_render_children syntax but just do a print drupal_render_children($form);

netentropy’s picture

I am having the same issue. Did you find a solution?

nbb’s picture

This may happen when you forget to render the form's hidden data in your form template file.
In case you're theming the form in node-form-tpl.php
you may code like this:

<div class="special-formatting">
...
<?php print drupal_render($form['title']); ?>
<?php print drupal_render($form['body_field']['body']); ?>
<?php print drupal_render($form['description']); ?>
<?php print drupal_render($form['buttons']); ?>
...
<?php unset($form['extra_field']); ?>
<?php drupal_render($form); ?>
</div>

What you should not forget is finishing your template with this drupal_render($form);
which outputs #form_build_id and others. In my case that is exactly filefield was missing.
Should you not need extra fields being printed by that last line you can handle those values or unset them safely beforehand like unset($form['extra_field']);

El Bandito’s picture

Hi

I'm seeing the same error "An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (64 MB) that this server supports." when I try to upload a file. My hosting company have also recently upgraded to php 5.3.

Did any of you guys/girls find any solutions ?

Thanks

Web Assistant’s picture

Whenever this comes up I just tell people to disable Javascript temporarily to upload the file. Not worked out the problem yet.

El Bandito’s picture

Thanks. The problem I have is that the issue occurs when uploading a file and when I disable Javascript the Upload button simply doesn't work. Aaaaaagh.

El Bandito’s picture

I don't know if it helps ( sadly doesn't help me ! ) but the browser console reports that it is receiving a "406 ( not acceptable )" error from the server.

Web Assistant’s picture

When disabling Javascript, the upload should work when the node is saved.

catrielmuller’s picture

Subscribe

Web Assistant’s picture

I'm wondering if mod_security has something to do with this?

smira’s picture

disabling FileField Nginx Progress worked for me.
definitely a fix and not a solution but better than nothing for now.

Andreas Radloff’s picture

Although I'm getting the message "[node title] (Article) has been updated", but in watchdog when I click the post for "article: updated" and click the link listed under location (/file/ajax/field_image/sv/0/form-d8ZU-fLW85NtIKBHidbL7-ZLsNWQ-_nySK5QD160gqo) I see a json string ending with the "exceeded the maximum file size" message. I did not have this problem under php 5.2 (I'm on 5.3 now). Deletes fine with js turned off.

Drupalutvecklare | Drupal Developer in Sweden

Anonymous’s picture

LiquidWeb chat support says it's ModSecurity. modsec, part of the firewall, blocks when I try to upload images. They have to whitelist all of your content creation image upload URLs.

Anonymous’s picture

They white-listed the rule that was blocking, not the URLs, and then rebuilt apache and modsec.