From a5c08d0f9ea2847d4f05748fb04b31b566d31910 Mon Sep 17 00:00:00 2001 From: Gaetan SENN Date: Thu, 12 Mar 2026 00:11:19 +0100 Subject: [PATCH 1/5] feat: add storage parameter info --- content/guides/05.files/1.upload.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/content/guides/05.files/1.upload.md b/content/guides/05.files/1.upload.md index e1abdc27..649b5f27 100644 --- a/content/guides/05.files/1.upload.md +++ b/content/guides/05.files/1.upload.md @@ -26,6 +26,7 @@ Optionally, you can also click the file display to open the file details page an ## API ::code-group + ```http [REST] // POST /files @@ -37,15 +38,16 @@ Body must be formatted as a `multipart/form-data` with a final property called ` ``` ```js [SDK] -import { createDirectus, rest, uploadFiles } from '@directus/sdk'; +import { createDirectus, rest, uploadFiles } from "@directus/sdk"; -const directus = createDirectus('https://directus.example.com').with(rest()); +const directus = createDirectus("https://directus.example.com").with(rest()); const formData = new FormData(); -formData.append('file_1_property', 'Value'); -formData.append('file', raw_file); -formData.append('file_2_property', 'Value'); -formData.append('file', raw_file_2); +formData.append("storage", "s3"); // optional, defaults to first STORAGE_LOCATIONS +formData.append("file_1_property", "Value"); +formData.append("file", raw_file); +formData.append("file_2_property", "Value"); +formData.append("file", raw_file_2); const result = await directus.request(uploadFiles(formData)); ``` @@ -54,3 +56,6 @@ const result = await directus.request(uploadFiles(formData)); 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`. + +You can optionally provide a `storage` property to specify which storage location to use. If omitted, it defaults to +the first location configured in the `STORAGE_LOCATIONS` environment variable. From 0ca27b1059133696f413059ebe69d48e5f7a0dc4 Mon Sep 17 00:00:00 2001 From: Gaetan SENN Date: Fri, 13 Mar 2026 17:00:25 +0100 Subject: [PATCH 2/5] Update content/guides/05.files/1.upload.md Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> --- content/guides/05.files/1.upload.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/guides/05.files/1.upload.md b/content/guides/05.files/1.upload.md index 649b5f27..46a32b3c 100644 --- a/content/guides/05.files/1.upload.md +++ b/content/guides/05.files/1.upload.md @@ -57,5 +57,7 @@ const result = await directus.request(uploadFiles(formData)); 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`. -You can optionally provide a `storage` property to specify which storage location to use. If omitted, it defaults to -the first location configured in the `STORAGE_LOCATIONS` environment variable. + +::callout{icon="material-symbols:info" color="info"} +If `storage` is not specified, it defaults to the first location listed in [`STORAGE_LOCATIONS`](/configuration/files#storage-locations). +:: From 7d7a9757597dea9166b7e5d58a141f78c6bdb4d3 Mon Sep 17 00:00:00 2001 From: Gaetan SENN Date: Fri, 13 Mar 2026 17:08:49 +0100 Subject: [PATCH 3/5] refactor: revert to single quote --- content/guides/05.files/1.upload.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/content/guides/05.files/1.upload.md b/content/guides/05.files/1.upload.md index 46a32b3c..818fa7d0 100644 --- a/content/guides/05.files/1.upload.md +++ b/content/guides/05.files/1.upload.md @@ -38,16 +38,15 @@ Body must be formatted as a `multipart/form-data` with a final property called ` ``` ```js [SDK] -import { createDirectus, rest, uploadFiles } from "@directus/sdk"; +import { createDirectus, rest, uploadFiles } from '@directus/sdk'; -const directus = createDirectus("https://directus.example.com").with(rest()); +const directus = createDirectus('https://directus.example.com').with(rest()); const formData = new FormData(); -formData.append("storage", "s3"); // optional, defaults to first STORAGE_LOCATIONS -formData.append("file_1_property", "Value"); -formData.append("file", raw_file); -formData.append("file_2_property", "Value"); -formData.append("file", raw_file_2); +formData.append('file_1_property', 'Value'); +formData.append('file', raw_file); +formData.append('file_2_property', 'Value'); +formData.append('file', raw_file_2); const result = await directus.request(uploadFiles(formData)); ``` From bc1d7b089ef551713343ae89227b9c0fdb76c6bb Mon Sep 17 00:00:00 2001 From: Gaetan SENN Date: Fri, 13 Mar 2026 17:09:39 +0100 Subject: [PATCH 4/5] refactor: clean up --- content/guides/05.files/1.upload.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/guides/05.files/1.upload.md b/content/guides/05.files/1.upload.md index 818fa7d0..e1088eeb 100644 --- a/content/guides/05.files/1.upload.md +++ b/content/guides/05.files/1.upload.md @@ -26,7 +26,6 @@ Optionally, you can also click the file display to open the file details page an ## API ::code-group - ```http [REST] // POST /files From c2daa6b4bf374e0d1e933e6dea2ecb60e29bf1c6 Mon Sep 17 00:00:00 2001 From: Gaetan SENN Date: Fri, 13 Mar 2026 17:11:11 +0100 Subject: [PATCH 5/5] refactor: remove line --- content/guides/05.files/1.upload.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/guides/05.files/1.upload.md b/content/guides/05.files/1.upload.md index e1088eeb..b29ef974 100644 --- a/content/guides/05.files/1.upload.md +++ b/content/guides/05.files/1.upload.md @@ -55,7 +55,6 @@ const result = await directus.request(uploadFiles(formData)); 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`. - ::callout{icon="material-symbols:info" color="info"} If `storage` is not specified, it defaults to the first location listed in [`STORAGE_LOCATIONS`](/configuration/files#storage-locations). ::