ROQ provides a complete solution for file management, including these features:
- File upload using the UI component
- Files visiblity (public or private)
- File associations (files can be related to any object)
ROQ’s file management provides multiple UI components which can be integrated into your application:
<FileUpload/>component represents a button which opens a file selector and starts uploads.
<FileDropzone/>UI component represents an area on your application where users can drag and drop files to be uploaded.
<FileActiveUploads/>component shows a progress bar of all active files uploads.
Files that are uploaded to ROQ Platform are stored on Scaleway Object Storage (opens in a new tab). The data center is located in Paris.
Files can be uploaded via File Upload UI component or programmatically using the createFileUpload() API. The upload is realized using signed URLs, which means the files are uploaded directly from the user's browser to the object storage without sending it through your backend.
File categories can be managed via ROQ Console (opens in a new tab) only.
They have two purposes:
- Enable filtering by categories, see files() API
- Add validators to categories (see next section)
ROQ is using file categories to define rules for the upload in ROQ Console (opens in a new tab). For instance, you can set a category called "pictures" which requires the mime type of the uploaded file to be an image (see image mime type (opens in a new tab)). You can also restrict the maximum size of uploads.
A file can be either public or private. Public means that there is a permanent URL which can be used by anyone, while private files can only be accessed by user who are allowed to do so. The visibility of a file can be changed in ROQ Console or via makeFilePublic() / makeFilePrivate() APIs
You can define permissions of files using ROQ's access management feature. Files are always owned by the user who uploaded it. You can restrict the access to this user or enable users of the same tenant to download the file.
When a file is stored on ROQ Platform, then it usually belongs to another object. For instance PDF files can be uploaded and related to a "contract".
Additionally, you can also configure categories in ROQ Console (opens in a new tab)