Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Receiving this error when using a file field inside a field collection:
"An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (128 MB) that this server supports."
The error occurs if the field collection field on the content type is set for:
Number of values = Unlimited
Maximum number of values users can enter for this field.
'Unlimited' will provide an 'Add more' button so the users can add as many values as they like.
Comment | File | Size | Author |
---|---|---|---|
#11 | fcerror.png | 97.48 KB | Anonymous (not verified) |
#10 | fcerror2.png | 8.04 KB | Anonymous (not verified) |
#3 | fieldcollection.png | 39.01 KB | Anonymous (not verified) |
Comments
Comment #1
jmuzz CreditAttribution: jmuzz commentedI tried but I wasn't able to duplicate this. I made a simple content type with an unlimited cardinality field collection and put a file field inside it. I was able to upload files into the field when creating a node. I tried it by using the upload button and by leaving the file name there when submitting the form.
Can you provide more specific steps to make this error happen?
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedFirst off @jmuzz, thank you for helping with the Field Collection issue queue, much appreciated as this module is critical to Drupal's future, and needs more volunteers to show it some love.
I'm having a hard time isolating this issue. It is somewhat intermittent as I was able to upload files from a file field in a field collection as recently as yesterday and no new modules have been added to the site since then.
It is not a php.ini file upload size issue.
I tested again today with a new field collection on a new content type and found that the error is occurring even when maximum number of values for the field collection field is set to "one".
I checked permissions and ownership of the upload directory, then changed to the default directory and confirmed this was accessible by adding the same file field to a non field collection content type and successfully uploading a file.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #4
jmuzz CreditAttribution: jmuzz commentedIt seems to be a tricky message that many have run in to. It could be an issue with mod security if you are using it. Maybe one of these can help.
https://drupal.org/node/1928574
http://www.inmotionhosting.com/support/edu/drupal-7/311-fixing-the-an-un...
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks @jmuzz. I thought mod_security as well, but it is not running/installed.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedNoticed one more thing. I created another field collection with a long text field and a file field. If I add text to the text field and do not attempt to attach a file to the file field, the node cannot be saved. The node/add form reloads as blank on save.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedTried a new content type, new field collection with only two fields, a long text field an a file upload with audio upload widget. Left upload directory as default. Everything is working normally.
I wonder if this was related to directory permissions?
Also, when I first created the original file upload field, I may have included a directory structure that was not yet created. ie files/new_dir without actually creating "new_dir" until after first trying to upload content at node/add/content-type.
In any case, I am closing the issue as Field Collections appears to be working as expected.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedI found the cause of the file upload error.
When my field collection contains a long text field with "Token Insert" enabled, any file upload field returns the error message.
Not sure if this is a known issue?
This is repeatable. If Token Insert is disabled on all text fields, the file upload field(s) works normally.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #12
Anonymous (not verified) CreditAttribution: Anonymous commented