The File section enables you to view and manage all of the files (images, videos, audio files, and attachments) in your workspace. You can easily see and search the files of your workspace and see the file name, mime type, size, and date it was created.
Manage the files of a workspace all in one place.
If a file appears in this section then it is included in the overall media storage of your plan. Files will be represented here in two ways:
- 1.Uploading a file directly to the database.
- 2.Uploading a file directly to the File page.
- 3.Creating Metadata for any type of file in the function stack.
Files do not necessarily need to be added to your database to be a file of your workspace. Creating the metadata of a file through the function stack associates that file with your workspace - even if you do not add it to a record in one of your database tables.
File management is extra useful because files are not automatically removed from media storage. For example, deleting a record in the database that contains an image does not remove that image from media storage. If necessary, you can leverage the file management page to remove unwanted files from media storage.
**Deleting a file on the file management page is permanent. You should only do so if you are absolutely certain that you wish to permanently delete the file.**
Deleting a file on the file management page does not remove any database records associated with the file.
To delete a file:
- 1.Use the select box on the left side.
- 2.Click the red delete button (trash can icon).
- 3.Confirm the action. It cannot be undone so be absolutely sure you wish to delete the file.
How to delete a file.
When an image is stored in a database table and that record is deleted, the file is still available to anyone who has a direct link to that file. Xano provides a separate function to permanently delete files stored in your media storage.
Please ensure that any APIs utilizing the Delete File Resource function are properly secured. This action is permanent and files deleted are not recoverable.
The "Delete File Resource" function located in the Content Upload section when choosing a function
To delete a file permanently from your Files library, add the Delete File Resource function to your function stack and specify the path to the file. This is not the same as the complete URL to the file.
If your image URL is: https://abcd-1234-zyxw.xano.io/vault/SoykeabM/4T0/7ylaZg../image.png
...your path is /vault/SoykeabM/4T0/7ylaZg../image.png
Specifying a path in the Delete File function
Deleting a file does not remove references to that file in other places. This includes database tables. It is usually best paired with a function or functions to edit or delete the corresponding records.
Uploading a file directly to the file management page is useful if you wish to add a file to the cloud and create a link for it. Previously, this would require you to add schema to a database table and store the file in the database.
Upload a file to the cloud storage engine.
Once the file is uploaded, you can click on the file name to preview it, download it, or retrieve the URL reference to it.