I am working in codeless UI builder and i have used the file uploader button to upload files to a location. This is working.
Now i want to store that url into the table so the user can retrieve the file.
What is the correct way to do that? I am using the Save Object in Backendless block to store the data from a form, and i want the add the url to the table.
I have created the table with a column with FILE REFERENCE type.
This is working, but i am not sure if that is the correct way of doing this.
Now i want to restrict the access to this file by setting the permissions in the Files but this does not work. When i give the permissions to one specific user, then this user cannot see the file.
Only when i set the ServerCodeUser READ setting to OK then i see the file, but then any user can access it.
To store a “reference” to the file in a column with the FILE REFERENCE type, you need to save the file URL. Once you upload the file, you get the URL back of the uploaded file. Use that URL in the property of the object you save/update.
Could you please show how you restrict access to the file?
The URL you get and permissions are not related. URL is how a file is referenced. Permissions control what roles can or cannot get the file.
If you added permissions for a specific user, the file can be downloaded only by that user ONLY IF there if the request to get that file has the user-token HTTP header. If the http header is not passed, the request will be handled as if from a non-authenticated user.