File API (upload and reference)

Hi,

When referencing a file, we use a file reference column in the database.
Is it possible to have 1:N just like the object relation ?

If not possible, the only way is to create additional table to reference each file and then use the object-relation (1:N) to link to multiple files right ?

To create the row in the table, I’m using the “after upload” server code to add it in. Is it possible to have it working like in a transaction (meaning both the file upload and table insert needs to be completed successfully else the file should not be available in the folder).

Lastly is there any way to add additional parameter to the File API for upload (JS SDK) ?

Regards,
Francis

Hell @Francis_Thong

Is it possible to have 1:N just like the object relation ?

no, it is not possible

the only way is to create additional table to reference each file and then use the object-relation (1:N) to link to multiple files right ?

yes, that is the only way

Is it possible to have it working like in a transaction

unfortunately, no it is not.

Lastly is there any way to add additional parameter to the File API for upload (JS SDK) ?

it is not possible to ((

Hi,

Is there any particular reason for not allowing additional parameters for the File API?
In my opinion, when people upload a file, they will usually want to update some data as well. So allowing some extra parameters to be sent can help to reduce the number of api call.

File upload gets the file into the file storage. The file storage does not provide any mechanism for storing additional parameters, it stores only files. Any additional parameters can be saved in the database along with the URL to a file.

Regards,
Mark