Home › Forums › Bug Reports › The field 'file' doesn't save anything
Hi,
First of all, congratulation for this ACF plugin. you did an amazing job. Thank you.
I need your help please.
Another “doesn’t save” issue. After some investigation on hundreds of topics about this famous issue, as the last chance, I am trying to get your help here.
I have a field ‘file’ located on woocommerce account details. I use the plugin “Acf Woocommerce” to add some custom fields for my clients.
The field “File” allows the user to upload a file. When the client uploads a file and saves it, it will not save the file.
But as admin, in the front end, in the same ‘account details’ page for this same ‘file’ field, I can upload a file and successfully saved it.
I don’t understand what is the issue?
So I investigated in the database. I could see in table “usermeta” the rows regarding this ‘file’ field.
I noticed that the usermeta rows for admin had the id post of the field (6118),
whereas the rows for clients had the value ‘0’.
in the table post I could see that a row was created for this file added by Admin:
http://prntscr.com/rx9lxl
But no rows was created for the files added by clients.
Maybe ACF code is adding rows in table ‘usermeta’ before adding rows in table ‘posts’?
I have no idea why this issue happens?!! But it is annoying.
So I renamed this field, it doesn’t work.
I removed completely this field and recreate it, it doesn’t work.
I removed completely this field and recreate it with a new name, it doesn’t work.
When I change the type of this field to ‘URL’ for example, it works! It does save the value. But when I put it back to the ‘file’ type, it doesn’t save anything.
I hope all these info will help you to give me a solution. I really need this ‘file’ field working as soon as possible.
Have a great weekend.
The problem is that the user does not have permission to edit the post that the file is being attached to. You need to modify their permissions to allow them to attach files to the post type.
Thank you. I don’t understand why a user can not edit his own field. It is non-sense.
Anyway, where can I do that? The field attributes of “file” are:
Field Label
This is the name which will appear on the EDIT page
Field Name
Field Type
Instructions
Required?
Return Value
Library
Minimum
Maximum
Allowed file types
Conditional Logic
Wrapper Attributes
I don’t see anything about access rights. Could you help me please?
Because in WP this user does not have permission to add attachments whatever WooCommerce uses to store the account details. Yes, sometimes the rules can be tricky.
I don’t know how to accomplish this. You need to find a way to give users the permission to do this. I would start by asking WC if it is possible to alter permissions to the user profile to allow users to attach files to their own profile.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.