Skip Navigation

[Resolved] Upload file / image with CRED fails for some Users

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a CRED form that allows Users to upload files or images. When some Users are logged in, the upload process always fails with the message "There was an error uploading your file." When admin Users are logged in, the upload process works without any errors.

Solution: In this case, the custom role did not have the permission to create new Media posts in Toolset > Access Controls > Post Types > Media. Adding the permission solved the problem.

This support ticket is created 6 years, 9 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 10 replies, has 2 voices.

Last updated by Jacques Spijkers 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#629604
IMG_4945.JPG

I am trying to:

upload files with a CRED from an iPhone (7) There an error (see image)

Link to a page where the issue can be seen:

hidden link

I expected to see:

Instead, I got:

#629723

Hi, can you tell me more about this?
- Is the error consistent with all files and all file types?
- If you try to upload the same file using Safari on a desktop, is the error shown?
- Are any server-side errors logged when the file upload fails? If you are not familiar with server logs, I can show you how to activate them temporarily. Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Then 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');

Try to upload the file again using iOS. If any server-side errors are generated, 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 changes you made to wp-config.php.

#629740

Hi Christian,

Many thanks for your reply.

I've made changes tot the config. This is what te error logs tells us:

[29-Mar-2018 15:41:45 UTC] event-tickets/common - Log: Tribe Events initialiseren op Mar, 29th at 03:03:45 pm
[29-Mar-2018 15:41:45 UTC] event-tickets/common - Log: Tribe Events initialiseren op Mar, 29th at 03:03:45 pm

I've disabled the event-ticket plugins but the I still can't upload a file or image. Not in IOS an not at the MAC. Both in Safari and Chrome.

Jacques

#629741
Schermafdruk 2018-03-29 17.48.10.png

image

#629769

Okay I don't see anything in the logs that would indicate a server-side error here. Is it possible for me to log in and submit the form so I can watch for any JavaScript errors during submission? If that's okay please provide login credentials in the private reply fields here. If not, I need you to open the browser console in safari and watch for any JavaScript errors during image uploads.

#629864

Can you give me some step-by-step directions to reproduce the error? I just created this post with an iPhone and was able to upload an image from my camera roll without any problems: hidden link

I set it to Draft status for now.

#629871

Christian,

Oeps I gave You the wrong credentials. Sorry. It was the login of the admin. If you try:

- removed by admin -

It will give you the error.

Jacques

#630349

Okay thanks, I am able to replicate the problem now. It doesn't seem to have anything to do with being on an iPhone, because I'm able to replicate the problem on Chrome on my desktop. I looked at your Access Control settings and I can see that the custom role "Leerling" has no permission to publish Media items. This is why the image upload fails for this User. Please go to Toolset > Access Control > Berichttypes and toggle open the "Media" post type. Modify the permissions here so that Leerlings can publish Media, then try again. Let me know if this does not resolve the problem.

#630350

Christian,

Many, many thanks. I've overlooked that completely! Its works now and my customer is very happy.

Jacques

#630369

This is good news!

#630392

Grand and Golden support as always with Christian.