Skip to main content

Files Overview

Every file managed by the platform is uploaded to the configured storage adapter, and its associated metadata is tracked within the directus_files system collection. Any requested file transformations are handled on the fly, and are only saved to storage.

File Security

Data and permissions around files are associated to the directus_files collection.

It is recommended that you only provide public permissions to specific files or file folders (for example, a 'Public' folder), rather than making the whole collection public. Read more on custom access permissions.

Accessing a File

The location of your actual file originals is based on the project's configuration, but you can consistently access them via the API using the following URL.

example.trackvision.ai/assets/<file-id>
example.trackvision.ai/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4
File Access

By default all files are private and will require normal authentication to retrieve. If you want to make a file public, you can do so by manipulating the public role and sharing the file itself or a folder it is in. This can be useful for any image assets you want to use on a product web site etc. Also you can publish certificates or any other files you want to share publicly.

Downloading a File

To download an asset with the correct filename, you need to add the ?download query parameter to the request and the download attribute to your anchor tag. This will ensure the appropriate Content-Disposition headers are added. Without this, the download will work on the same domain, however it will have the file's "id" as the filename for cross-origin requests.

Example

<a href="https://customer.trackvision.ai/assets/<file-id>?download" target="_blank" download="Product Certification.pdf">Download</a>