From 7e1dfaaa86988692c66a63777dac89b6b2fa63a1 Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Tue, 3 Jun 2025 13:30:29 -0700 Subject: [PATCH 1/3] chore: Add callout for Android storage permissions --- .../build-a-backend/storage/download-files/index.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx b/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx index 551968469c7..4e46fc8bef3 100644 --- a/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx +++ b/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx @@ -336,6 +336,14 @@ const { body, eTag } = await downloadData({ Use the `downloadFile` API to download the file locally on the client. + +**Note:** When downloading a file that will overwrite prexisting file, ensure that your app has the proper write permission to overwrite it. In particular, if your app uses scoped storage, your app must must request that the user grant your app write access to that particular file [as described here](https://developer.android.com/training/data-storage/shared/media#update-other-apps-files) if a different app contributed that file to the media store. + +To learn more, refer to Android's developer documentation about [Scoped Storage](https://developer.android.com/training/data-storage#scoped-storage). + +Amplify will throw a `StorageException` if it is unable to modify a preexisting file. + + From 5471367e9f834d176b278332ca1e9a9f20532ee1 Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Tue, 3 Jun 2025 13:56:27 -0700 Subject: [PATCH 2/3] Fix typo --- .../[platform]/build-a-backend/storage/download-files/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx b/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx index 4e46fc8bef3..3be589e7321 100644 --- a/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx +++ b/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx @@ -337,7 +337,7 @@ const { body, eTag } = await downloadData({ Use the `downloadFile` API to download the file locally on the client. -**Note:** When downloading a file that will overwrite prexisting file, ensure that your app has the proper write permission to overwrite it. In particular, if your app uses scoped storage, your app must must request that the user grant your app write access to that particular file [as described here](https://developer.android.com/training/data-storage/shared/media#update-other-apps-files) if a different app contributed that file to the media store. +**Note:** When downloading a file that will overwrite preexisting file, ensure that your app has the proper write permission to overwrite it. In particular, if your app uses scoped storage, your app must must request that the user grant your app write access to that particular file [as described here](https://developer.android.com/training/data-storage/shared/media#update-other-apps-files) if a different app contributed that file to the media store. To learn more, refer to Android's developer documentation about [Scoped Storage](https://developer.android.com/training/data-storage#scoped-storage). From 43944ad3301b2c5099cd4d1532f1957ca59cc61f Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Wed, 4 Jun 2025 11:52:12 -0700 Subject: [PATCH 3/3] Update src/pages/[platform]/build-a-backend/storage/download-files/index.mdx Co-authored-by: Tyler Roach --- .../[platform]/build-a-backend/storage/download-files/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx b/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx index 3be589e7321..32347942173 100644 --- a/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx +++ b/src/pages/[platform]/build-a-backend/storage/download-files/index.mdx @@ -337,7 +337,7 @@ const { body, eTag } = await downloadData({ Use the `downloadFile` API to download the file locally on the client. -**Note:** When downloading a file that will overwrite preexisting file, ensure that your app has the proper write permission to overwrite it. In particular, if your app uses scoped storage, your app must must request that the user grant your app write access to that particular file [as described here](https://developer.android.com/training/data-storage/shared/media#update-other-apps-files) if a different app contributed that file to the media store. +**Note:** When downloading a file that will overwrite a preexisting file, ensure that your app has the proper write permission to overwrite it. If you are attempting to write to a file that a different app already contributed to the media store, you must request user consent[as described here](https://developer.android.com/training/data-storage/shared/media#update-other-apps-files). To learn more, refer to Android's developer documentation about [Scoped Storage](https://developer.android.com/training/data-storage#scoped-storage).