Skip Navigation

[Resolved] Getting image Upload failed -message (403 (Forbidden))

This support ticket is created 7 years, 3 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 7 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#480198

I am trying to:
Upload images to a public post form.

I visited this URL:
hidden link

Instead, I got:
This is not working. I get "Upoad Filed", and a message in Chrome concole:

Failed to load resource: hidden link - the server responded with a status of 403 (Forbidden)

I have spent too many hours on the forum trying to fix this now. About the hot fix you created in October, this is fixed in the latest update of Cred forms now.

I tried changing file permissions on the server. No luck. Cashing plugin is disabled now.

Next move?

#480420

Hi Johnny, I just tried to upload an image on your site using Chrome and Safari and I experienced the same error.

1. Can you tell me exactly what file permissions you have modified on the server?
2. Can you tell me if there are other image upload forms on your site (not CRED forms) that allow image uploads from the front-end?
3. Do you have a PHP ini file installed anywhere that I can see on this site?
4. Does your host have a Mod_Security rule implemented on your server?
5. Are there any other host restrictions on uploads?
6. Next move: enable debugging, attempt another upload, then see if any errors were generated in the log.

You can see how to enable debug logging here:
https://toolset.com/documentation/user-guides/debugging-toolset/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Edit your wp-config.php file and add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

This will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the updates you made to wp-config.php.

#482772

Hi Christian,

Sorry for the delay. Been too busy with client work.

I had another look at this again today. But

1. The only file permission I have changed is the one mentioned in the warning in Chrome: hidden link -But today it was a different file than the one I mentioned last time.

2. No, we don't have any other image upload forms right now.
3. There's no PHP ini file on the site, no.
4. Customer support says no Mod_Security is activated on the server
5. As far as CS said, there's no restrictions on uploads.
6. I did enable debugging on the site 2 weeks ago. But nothing much exciting is to be found here it seems. There were only some errors on WooCommerse. I have cleared the log and tried uploading again today.

The warning is instant. Like it's not even trying to upload the file even.

Hm, not much helpful info here today. Not sure how to move on with this 🙂

#482881

OK it makes sense that you're seeing a different file name today if you have activated or updated Toolset plugins. So I have a few suggestions:

1. Ensure the file permissions on the file mentioned in the error today are updated
2. Ensure you have enabled write access on the WordPress uploads directory (typically wp-content/uploads)
3. Check your .htaccess file to see if any restrictions exist there for uploads
4. Try the patch that can be found in this errata post: https://toolset.com/errata/upload-fails-wordpress-installed-directory/
5. Temporarily disable all other plugins except Toolset plugins and enable a default theme like twentysixteen

If none of these work, I will need to clone your site and install a copy locally for debugging. To do that, I would need access to your WordPress admin area, and permission to install Duplicator (https://wordpress.org/plugins/duplicator/) and create a clone. I will enable a private reply field here for you to send me login credentials.

#486351

Thanks, I'll standby for your update.

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