See also: How to share files through the Files Repository REST API?.
You can share binary files within the platform, between platform users and with external users, if you make the file public.
How to use it?
1) Go to https://<platform_instance>/controlpanel/files/list . You can also find this link from the menu:
Then, click in Create.
A modal will pop up, and you have to write down the 'metadata', which is optional, and select the file that you want to share.
There are two types of Storage Mode: Mongo GridFS and Directory(File). The default choice is GridFS and is the one recommended for several reasons. Either way it is transparent to the user.
Note: There is a limit in file size. Files up to 50MB are allowed.
2) Once uploaded, you will see the file in the list:
By default, uploaded files are not public and not shared, so if you want to share it with (non) platform users, you must click on the 'share' or 'public' button.
You can download the file by clicking the 'download' button or copying the url ('copy url to clipboard') if you plan to download it from a REST client.
Note: You need to provide credentials to download the file from a REST client if the file is not public.
Sharing
You can share the file with platform users by clicking the . You can allow users to read/write files.
You may also make the file public. In that case, anyone can download the file: , for example: https://www.onesaitplatform.online/controlpanel/files/5bb779a8008920000b398abf
You can also use the 6979591 to make CRUD operations with binary files.
Downloading the file
By default, if you click the Download button or paste the url in an explorer, the file will be downloaded as an attachment, but if you add the request parameter 'disposition', with any value, you will get the content of the file in the response body, instead of the attachment, for example:
https://<platform_instance/controlpanel/files/5bd875f6f32bbb9ec5550977 will give you the file
but changing it to:
https://<platform_instance>/controlpanel/files/5bd875f6f32bbb9ec5550977?disposition=x
will allow you to visualize the file embedded in the explorer.