This endpoint allows you to preview files stored in Directus. This is useful when you want to preview an image or PDF in the Live Preview.
- Install the extension using a package manager or from the Marketplace:
npm install directus-extension-file-preview-endpoint
-
Get the Filename (Disk) value of the file from the File Library.
-
Construct the URL:
Format:
<PUBLIC_URL>/file-preview/<filename_disk>
Example:
http://localhost:8055/file-preview/33461458-ed8b-4917-9f74-318ef4731ddf.png