Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Front End File Upload Permission
-
Dear Elliot,
First I want to thank you for this wonderful plugin.
I have a little issue with the front-end image upload form and user permissions.
When in back-end, contributors and authors can upload images without any problem, but when in front-end, the media upload form shows the "Cheatin' Uh?" message.
However, logged as an admin, everything works.
I deactivated all my other plugins, but still no luck.
Hope I've made sense and that you can help me.
Cheers,
Charles -
Looks like a user permissions issue.
Not sure on a solution for this one. Are you using the native acf form functions? -
Yes I am.
I found a way to edit the restrictions directly in the code...
Thanks again for this great module!
-
Hi Charles,
I'm having the same issue but can't find a way to edit the restrictions. Would you mind sharing your solution? Thanks! -
hello all,
I found it.
This is arriving when uploading a photo using an acf form.
I found the treatment here :
http://wordpress.org/support/topic/cheatin-uh-when-trying-to-upload-media-via-3rd-party-theme?replies=26
So i had to change in that file :
wp-content\plugins\advanced-custom-fields\js\input-actions.js this line :tb_show( acf.text.file_tb_title_add , acf.admin_url + 'media-upload.php?post_id=' + acf. ...
and replace it by :tb_show( acf.text.file_tb_title_add , acf.admin_url + 'media-upload.php?post_ID ....
and it works !
Bye ...
-
-
Still not working.... always error
-
The fix proposed by Mouzaia is totally wrong. Its not the correct solution for the problem.
I would debug the post id first and check if the user has permissions to access and add media to particular post.. When we are in frontend upload mode the post_id we have can be the $post->id of the post we are seeing currently -the one where the form is included - not the one we are editing. So thats in most cases is the problem of the wrong permissions not the plugin itself.
I have fixed it by adding small JS before including frontend form like
//changing post id for frontend upload
echo 'acf.post_id = $post_id_here;';
This way we can esnure that we are accessing the right post id and the user has permissions to access that post id. -
-
@admin
Hi Ellliot,
Yes - but at the time I was working on a solution it wasn't and I saw this advice above and I wanted to clarify some things - that changing id to ID does more harm than good.
Anyway thanks ;) -
-
Hey,
I'm talking about the solutions proposed above by Mouzaia or Lupetalo. Those solutions are everywhere around the Internet but none of them is correct and done in proper way. Those kind of "solutions" with core tweaking etc are then repeated all accross the Internet and copied without thinking. That is why I've said that its making more harm than good :) -
to be deleted