Replies: 2 comments 5 replies
-
The response on create is based on the read permissions. Does this user have the read permissions for the id field? |
Beta Was this translation helpful? Give feedback.
0 replies
-
No that's part of the problem. It is on purpose because the point here is only to upload something then get the file ID to create another item on another collection. The file is only read by an admin. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone!
I am actually facing a permission issue in my current project. It is allowed to create a file but read access is restricted given on a custom
directus_files
field (is_public
).Upload works as expected (
POST /files
) but the API response is empty if the file cannot be read. The problem is that it is impossible to get the ID of the uploaded file. I presume it happens with any collection so maybe someone has a solution for this problem?I tried to change the response in a
files.create
hook (I wanted to manually add the new file ID) but it is not possible to access the response in a hook.The only suggestion would be to upload files from a custom endpoint? :/
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions