Skip Navigation

[Resolved] File upload not working: 500 internal server error on custom upload fields

This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by peg 7 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#388505

peg
console.jpg
server.jpg
upload_failed.jpg

I am out of ideas...
None of my upload fields (files and images) does work any more... since all the latest updates.
I am getting a 500 internal server error message and a "upload failed" message right after the file is uploaded. (But where?? - nothing is shown in the media library)
In the same form the build in featured image is uploaded fine.
So, it's only about the types file / image upload field.

Now, what can I do?
Have a look at the attached screenshots.

I have to say, though, that my uploads folder is moved outside of wp:
/mysite.com/files

I have moved it back to wp-content/ on a test site but that did not do the trick...

wp-content and files folders are set to php user -> 755 and 644
all the latest updates are installed
switched theme - no difference

Any ideas, what else it could be?

#389227

Dear peg,

I can not duplicate same problem, I suggest you check these:
1) You are using the latest version of Toolset plugin
2) Make sure the "uploads" is in the default folder "wp-content" folder
3) Deactivate other plugins and switch to wordpress default theme 2016, and test again.

#390152

peg

Hi Luo,
I have spent the entire day yesterday with moving my uploads folder back to wp-content, even rename it to "uploads".
That somehow destroyed all settings regarding any image in the entire site since my theme uses a page builder and it stores those elements kind of everywhere.
This would mean a lot of work and a possible redesign of everything.
Further it did again make no difference, I got the message "upload failed".
So I converted everything back to normal - means I put the uploads folder back outsite of wp-content.
Later I found that my firewall was blocking some of the uploads because I had enabled it to sanitize uploads... This seemed to work for featured images but not for file or image uploads from types.
However, the 500 server error is gone.

The interesting part comes now:
I have a few forms with 1 file upload field.
The upload suddenly seems to work - though the validation does not on these fields...

Then I have another form that has 5 upload image fields included and none of it lets me upload anything. There is no 500 server error on the page but still I am getting a "upload failed".
The file data array for those fields is empty.
Then I look into the media library and the images are uploaded there and attached to the post. But they are not loaded into the post (showing up in the post template).

The whole thing is weird and really annoys me since I do not know where the problem is.

Is it really important to have the uploads folder in wp-content? And why? All other plugins work with the customized file structure perfectly. Just not those file and image uploads from toolset...

I can confirm that no plugin and no theme is interfering.

Anyway, if you have an idea what else I could check, please let me know.

#390413

It seems to be a server problem, please enable PHP debug mode, and copy/paste the debug logs here:
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

#391806

peg

Hi Luo,
I found what was causing the issue. At the end it was my cred form validation...
Now all is working fine.
Thanks for the tip with the error log.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.