Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Help diagnosing file upload failures with "Sorry your upload failed" message


Go to End


2 Posts   1414 Views

Avatar
Voodoo Priest

Community Member, 32 Posts

19 August 2016 at 8:09am

Edited: 20/08/2016 4:14am

I am running SilverStripe 3.4.0 on a CentOS 6.8 virtual private server on which the webserver is apache:apache.

The VPS was set up using ISPConfig and PHP is configured to run on the domain as the user created by ISPConfig, i.e. web1:client1.

The problem I am facing is that when I upload a file to the CMS backend (Files) by dropping it in the drop area, the progress bar reaches 100% but then, I receive a "Sorry your upload failed" message (without any more details as to why the upload failed) and the area that contains the file name turns red, with a "Internal server error" on the right hand side of the progress bar.

All error logs (Apache, PHP) are empty. SilverStripe log I have configured as shown below is also mute about this error.

SS_Log::add_writer(new SS_LogFileWriter('../sstripe_debug.log'), SS_Log::WARN, '<=');

The weird thing is that I have uploaded small (11 kB) PDF files without a problem, but a bigger PDF file (320 kB) gives me the error. Since upload_max_filesize is at 8 MB, as is post_max_size, it's not a size problem. It's also not a file name extension problem as this problem would have been reported where I now have "Internal Server Error". I infer from the smaller file uploads being successful that it's also not a permissions problem on the "assets" folder as hinted to here.

I'm looking for pointers to diagnose the problem. The developer guide page about UploadField did not help me much. But since I have XDebug running, I can track down the source of the issue if a developer could send me in the right direction. Is there somewhere a description of the client-server interaction/dialog when a user uploads a file?

[EDIT] By uploading files of various sizes, I discovered that anything above 128 kB causes the error. All smaller files are uploaded without any problems.

Avatar
Voodoo Priest

Community Member, 32 Posts

22 August 2016 at 12:55am

Edited: 22/08/2016 2:06am

I have asked about this issue on StackOverflow.

It turns out that there is a configuration to do for mod_fcgid, which, starting from version 2.3.6, has a default maximum value of 128 kiB. Setting FcgidMaxRequestLen to a value in bytes defining a size will do the trick.

Obviously, a recent system update caused this issue, which I had never met in 4 years (from SilverStripe 2.4.7 to 3.4.0).