Error: "The file could not be uploaded" when trying to upload additional files to an existing node.

Created on 19 November 2013, about 11 years ago
Updated 21 October 2023, over 1 year ago

I am seeing a problem when trying to upload additional files to a file field that already had files uploaded. I get the error message on the page that says: "The file could not be uploaded". (See the attached "ErrorMessage.jpg").

When I view the details of this error message in the "Recent Log Messages" report, it appears that the wrong folder name is being used to upload additional files. The details of the error message state that "The upload directory public://FilesLists/<em>Edit Files List</em> Planning Forms for the file field field_files could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled." - See the attached "ErrorLogDetails.jpg".

This upload directory is clearly wrong, it should be "public://FilesLists/planning-forms". "planning-forms" is the machine name of the node I'm updating that has the multiupload file field. When I first upload files to this node they are stored in "sites/default/files/FileLists/planning-forms".

Steps to re-create:

1. I have created a content type called a "FilesList" this contains a file field which uses the multiupload file field widget (see the attached "FilesListContentType.jpg").

2. In the "File (Field) Path Settings" for the multiupload file field I have the File Path set to "FilesLists/[node:title]" - See the attached "FileFieldPathSettings.jpg".

3. I then created a node called "planning-forms" of type "FilesList". When I initially create this node and upload multiple files to it, they are handled fine and stored in the "sites/default/files/FileLists/planning-forms" directory. So I don't believe that there are any problems with permissions on any of the relevant folders.

4. When I go back and edit the node, and try to upload more files to the same file field, using the multiupload file field widget, I see the error.

I don't think this is related to files size or number limits. I have increased the values in my php.ini to allow uploads of 28MB, rather than the default 8MB. I have also increased the limit on the number of files allowed from 20 to 100.

These limits are working okay, as I have uploaded more than 20 files to one of these nodes at the initial creation stage, and the multiupload file field widget is reflecting the new size limit by saying that "Files must be less than 28 MB."

In any case, the files here do not get anywhere near that limit in size.

Do you think I am doing something wrong here, or does this look like a bug?

🐛 Bug report
Status

Closed: works as designed

Version

1.11

Component

Code

Created by

🇮🇪Ireland lphilp00

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark ressa Copenhagen

    Yes, as was already discovered, this typically happens if there is no write permissions to one or more folders under sites/all/files, but only access.

Production build 0.71.5 2024