Files
directus/docs/concepts/files.md
Rijk van Zanten 817ccf3620 Overhaul docs (#3951)
* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

Co-authored-by: Ben Haynes <ben@rngr.org>
2021-02-05 18:51:54 -05:00

3.4 KiB

Files

Directus offers a full Digital Asset Management (DAM) system. This includes multiple storage adapters, nested folder organization, private file access, image editing, and on-demand thumbnail generation.

Directus allows you to manage all your files in one place, including documents, images, videos, and more. Files can be uploaded to the File Library in general, or directly to an item via a Single File or Multiple Files field.

Relevant Guides

File Fields

Directus ships with a full-featured system for digital asset management, with the following fields:

  • Title — Pulled from the file metadata if available, falls back to a formatted version of the filename
  • Description — Pulled from the file metadata if available
  • Tags — Pulled from the file metadata if available
  • Location — Pulled from the file metadata if available
  • Storage — The storage adapter where the asset is saved (readonly)
  • Filename Disk — The actual name of the file within the storage adapter
  • Filename Download — The name used when downloading the file via Content-Disposition

The sidebar's info component also includes the following readonly details:

  • Type — The MIME type of the file, displayed in the App as a formatted media type
  • Dimensions — (Images Only) The width and height of the image in pixels
  • Size — The file-size the asset takes up within the storage adapter
  • Created — The timestamp of when the file was uploaded to the project
  • Owner — The Directus user that uploaded the file to the project
  • Folder — The current parent folder that contains the file
  • Metadata — Metadata JSON dump of the file's EXIF, IPTC, and ICC information

Storage Adapters

Storage adapters allow project files to be stored in different locations or services. By default, Directus includes the following adapters:

  • Local Filesystem — The default, any filesystem location or network-attached storage
  • S3 or Equivalent — Including AWS S3, DigitalOcean Spaces, Alibaba OSS, and others
  • Google Cloud Storage — A RESTful web service on the Google Cloud Platform

Embedded Assets

Directus also supports ingesting third-party embedded assets, such as YouTube or Vimeo videos. These are managed the same as normal files, however the resource itself is stored on the external service, and referenced via its proprietary UID.

Thumbnail Transformations

Our file middleware also allows for cropping and transforming image assets on the fly. This means you can simply request an image, include any desired transformation parameters, and you'll be served the new asset as a response. This is very useful for automatically generating many different thumbnails/versions of an original file.

To impede malicious users from consuming your storage by requesting a multitude of random sizes, Directus includes a Asset Allow-List to limit what transformations are possible.

Relevant Guides