Files
Upload Files
Learn to upload files to Directus via both the data studio or API.
Multiple files can be uploaded simultaneously via both the data studio and via the API. File uploads are not limited to just images, they can be any kind of file.
Data Studio
By opening the files module on the left, you will see your file library, which acts as one big folder to store all uploaded files and sub-folders.
Create a folder called Images
and click on .
You'll see a popup with options for uploading your file:
- Dragging a file from your desktop.
- Clicking on the popup area to select a file from your machine.
- Clicking on the menu in the popup and selecting "Import from URL"
Optionally, you can also click the file display to open the file details page and fill in information as desired.
API
// POST /files
Body must be formatted as a `multipart/form-data` with a final property called `file`.
The file contents has to be provided in a property called file
. All other properties of
the file object can be provided as well, except filename_disk
and filename_download
.