[Resolved] Uploading image file in CRED Editing Form requires Admin privilege
This thread is resolved. Here is a description of the problem and solution.
Problem:
Guests who have Access permissions to a CRED form are unable to upload images in a custom field. An error is shown "There was an error uploading your file.
Solution:
I see this issue is already reported in our internal ticket system to our Devs and its known to us.
Please open a new ticket if you see this issue on your own site.
Relevant Documentation:
This support ticket is created 6 years, 6 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.
I am trying to: CRED form was working fine for 3+ years for uploading a portrait image (type Image). Now, for some reason only admins are able to complete the upload. Other users receive "There was an error uploading your file" shortly after the progress bar begins. I looked in ACCESS but don't see anything particular about uploading images. I don't know if I changed something and caused this, or if it may have been caused by a Toolset update, or what. Any ideas where I might take a deeper look or what to check?
Link to a page where the issue can be seen:
Requires Member Login.
Hello. Thank you for contacting the Toolset support.
Well - could you please give me problem URL and access details so I can check whats going wrong there.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Is there a reason we need to check for $current_user->ID == 0 ?
I realize the form I pointed you to was for users NOT logged in, but I have another (edit) form that also allows upload of an image file. I removed that part of the if statement and it seems to work fine for both forms. I just wonder if not checking the user ID poses any potential problem.
Is there a reason we need to check for $current_user->ID == 0 ?
==> I think the issue is for only guest users, that is why we are checking the user ID = 0.
I realize the form I pointed you to was for users NOT logged in, but I have another (edit) form that also allows upload of an image file. I removed that part of the if statement and it seems to work fine for both forms. I just wonder if not checking the user ID poses any potential problem.
==> Please check if you have issue with edit form then as you said remove the ID and use the code.