From cddec1b91e4ae173d6f8ab60b1073023dd3d8fa5 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Thu, 27 Feb 2025 15:53:54 -0800 Subject: [PATCH 1/4] chore: remove inaccuarte information about downloadData --- .../build-a-backend/storage/download-files/index.mdx | 4 ---- .../[platform]/build-a-backend/storage/download/index.mdx | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) 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 98d1db1672a..e0ea6907508 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 @@ -1239,10 +1239,6 @@ Option | Type | Default | Description | ## Frequently Asked Questions -- `downloadData` is cached; if you have recently modified a file you may not get the latest version right away. You can pass in `cacheControl: 'no-cache'` to get the latest version. -- `downloadData` only returns the latest cached version of the file; there is [not yet an API to view prior versions](https://github.com/aws-amplify/amplify-js/issues/2131). - [Image compression](https://github.com/aws-amplify/amplify-js/issues/6081) or CloudFront CDN caching for your S3 buckets is not yet possible. -- There is no API for [Cognito Group-based access to files](https://github.com/aws-amplify/amplify-js/issues/3388). -- There is currently [no API for getting the `identityId` of other users](https://github.com/aws-amplify/amplify-js/issues/5177); you have to retrieve this from elsewhere before calling `Storage.get`. diff --git a/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx b/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx index f1cea9965f1..9d01ca530e2 100644 --- a/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx @@ -366,10 +366,7 @@ Learn more about how to setup an appropriate [CORS Policy](/gen1/[platform]/prev Users can run into unexpected issues, so we are giving you advance notice in documentation with links to open issues - please vote for what you need, to help the team prioritize. -- `downloadData` is cached; if you have recently modified a file you may not get the latest version right away. You can pass in `cacheControl: 'no-cache'` to get the latest version. -- `downloadData` only returns the latest cached version of the file; there is [not yet an API to view prior versions](https://github.com/aws-amplify/amplify-js/issues/2131). - [Image compression](https://github.com/aws-amplify/amplify-js/issues/6081) or CloudFront CDN caching for your S3 buckets is not yet possible. -- There is no API for [Cognito Group-based access to files](https://github.com/aws-amplify/amplify-js/issues/3388). -- There is currently [no API for getting the identityId of other users](https://github.com/aws-amplify/amplify-js/issues/5177); you have to retrieve this from elsewhere before calling `Storage.get`. +- There is currently [no API for getting the identityId of other users](https://github.com/aws-amplify/amplify-js/issues/5177); you have to retrieve this from elsewhere before calling `downloadData`. From 40e494cc2cae33d1dd913d768d20ca17f6cab4ff Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Thu, 27 Feb 2025 17:16:20 -0800 Subject: [PATCH 2/4] chore: resolve commments --- .../[platform]/build-a-backend/storage/download-files/index.mdx | 2 ++ .../gen1/[platform]/build-a-backend/storage/download/index.mdx | 1 + 2 files changed, 3 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 e0ea6907508..551968469c7 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 @@ -1240,5 +1240,7 @@ Option | Type | Default | Description | ## Frequently Asked Questions - [Image compression](https://github.com/aws-amplify/amplify-js/issues/6081) or CloudFront CDN caching for your S3 buckets is not yet possible. +- `downloadData` does not provide a cache control option and it replies on runtime HTTP caching behavior. If you need to bypass the cache, you can use the `getUrl` API to create a presigned URL for downloading the file. +- `downloadData` does not support S3 object versioning, it always downloads the latest version. diff --git a/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx b/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx index 9d01ca530e2..d10a67bcf41 100644 --- a/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx @@ -368,5 +368,6 @@ Users can run into unexpected issues, so we are giving you advance notice in doc - [Image compression](https://github.com/aws-amplify/amplify-js/issues/6081) or CloudFront CDN caching for your S3 buckets is not yet possible. - There is currently [no API for getting the identityId of other users](https://github.com/aws-amplify/amplify-js/issues/5177); you have to retrieve this from elsewhere before calling `downloadData`. +- `downloadData` does not provide a cache control option and it replies on runtime HTTP caching behavior. If you need to bypass the cache, you can use the `getUrl` API to create a presigned URL for downloading the file. From 52d10b730e23d99d1ab86697a3e540f1bd82a962 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Thu, 27 Feb 2025 17:25:04 -0800 Subject: [PATCH 3/4] chore: add gen2 access type link for group access --- .../gen1/[platform]/build-a-backend/storage/download/index.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx b/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx index d10a67bcf41..299df495dcd 100644 --- a/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/storage/download/index.mdx @@ -369,5 +369,7 @@ Users can run into unexpected issues, so we are giving you advance notice in doc - [Image compression](https://github.com/aws-amplify/amplify-js/issues/6081) or CloudFront CDN caching for your S3 buckets is not yet possible. - There is currently [no API for getting the identityId of other users](https://github.com/aws-amplify/amplify-js/issues/5177); you have to retrieve this from elsewhere before calling `downloadData`. - `downloadData` does not provide a cache control option and it replies on runtime HTTP caching behavior. If you need to bypass the cache, you can use the `getUrl` API to create a presigned URL for downloading the file. +- `downloadData` does not support S3 object versioning, it always downloads the latest version. +- There is no API for [Cognito Group-based access to files](https://github.com/aws-amplify/amplify-js/issues/3388). You may use [Amplify Gen2 Storage](/[platform]/build-a-backend/storage/authorization/#access-types) to achieve this. From 369848e1669ea966ffcedfc2d5d4fed14fcbf460 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Fri, 28 Feb 2025 15:22:57 -0800 Subject: [PATCH 4/4] chore: fix heading order caused accessibility check failures --- src/fragments/lib/storage/android/download.mdx | 6 +++--- src/fragments/lib/storage/ios/download.mdx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fragments/lib/storage/android/download.mdx b/src/fragments/lib/storage/android/download.mdx index 8ad6e4241ba..d9d87dbebba 100644 --- a/src/fragments/lib/storage/android/download.mdx +++ b/src/fragments/lib/storage/android/download.mdx @@ -2,7 +2,7 @@ {/* TODO Rewrite monitor progress of download for iOS/Flutter/Android? */} -#### With StoragePath +### With StoragePath @@ -130,7 +130,7 @@ download To track progress of the download, use the `downloadFile` API that includes a progress listener callback. -#### With StoragePath +### With StoragePath @@ -268,7 +268,7 @@ download You can also retrieve a URL for the object in storage: -#### With StoragePath +### With StoragePath diff --git a/src/fragments/lib/storage/ios/download.mdx b/src/fragments/lib/storage/ios/download.mdx index 5cef62a0914..ed18d010b15 100644 --- a/src/fragments/lib/storage/ios/download.mdx +++ b/src/fragments/lib/storage/ios/download.mdx @@ -4,7 +4,7 @@ There are three ways of getting data that was previously uploaded: You can download to in-memory buffer [Data](https://developer.apple.com/documentation/foundation/data) object with `Amplify.Storage.downloadData`: -#### With StoragePath +### With StoragePath @@ -48,7 +48,7 @@ let resultSink = downloadTask -#### With Key (Deprecated) +### With Key (Deprecated) @@ -96,7 +96,7 @@ let resultSink = downloadTask You can download to a file [URL](https://developer.apple.com/documentation/foundation/url) with `Amplify.Storage.downloadFile`: -#### With StoragePath +### With StoragePath @@ -158,7 +158,7 @@ let resultSink = downloadTask -#### With Key (Deprecated) +### With Key (Deprecated) @@ -296,4 +296,4 @@ downloadTask.resume() Download tasks are run using `URLSessionTask` instances internally. You can learn more about them in [Apple's official documentation](https://developer.apple.com/documentation/foundation/urlsessiontask). - \ No newline at end of file +