Skip Navigation

[Resolved] "There was an error uploading your file" when uploading image

This support ticket is created 6 years, 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by PiotrO586 6 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#920078

Hi,

I have a form with a field for uploading images. When I am logged as an admin the image is uploaded, however, when I am logged as another user (with another role), I receive the following error: There was an error uploading your file.

There is similar issue posted: https://toolset.com/forums/topic/image-upload-in-front-end-cred-form-not-working-for-visitors/, but instead for the guests, I see that error for logged in users other than admin.

I have set up Access to manage post types. The role in question has also "publish" capability within Media post type, and publish capability of the post type, where the form is included.

#920191

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Piotr

I tested this locally on my own site and I didn't see any problems, it worked as expected, so there must be something specific to your installation.

I'll need you to rule out compatibility problems, but first please check for errors in your logs.

If you haven't already, turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

That will create a file debug.log in your wp-content/ directory which you can examine in any text editor. Try using the form again and then inspect the log. If you don't find the debug.log file it means it didn't generate any warnings or errors.

Otherwise, can you try disabling all non-Toolset plugins to see if the image upload works. If so you can re-activate your other plugins and try to identify which one causes the problem.

You can try the same with your theme, switching to the twentyseventeen theme and re-testing.

Please let me know what you find.

#920398

Oh..., I had small plugin which prevented access to WP dashboard to anyone except admin, and this line caused problem:

&& $_SERVER[ 'DOING_AJAX' ] != '/wp-admin/admin-ajax.php' )

Must find another approach.

Sorry for raising alarm!