aws-amplify / aws-amplify/docs

Download files demo code has syntax error

Open
#7,490 2 comments 0 reactions 0 assignees View on GitHub
amplify/content amplify/gen2
Dominant language
MDX
Stars
506
Forks
1.1k
Avg merge
3h 14m
Merged PRs (30d)
1

Description

**Describe the content issue**:
[Get or download file from a URL](https://docs.amplify.aws/javascript/build-a-backend/storage/download-files/#get-or-download-file-from-a-url) the same code' syntax is not correct:
```
const linkToStorageFile = await getUrl({
path: "album/2024/1.jpg",
// Alternatively, path: ({identityId}) => `album/{identityId}/1.jpg`
options: {
validateObjectExistence?: false, // [error:] extra question mark
expiresIn?: 20 // [error:] extra question mark, no comma
useAccelerateEndpoint: true; // [error:] comma instead of semi-colon
},
});
```

**URL page where content issue is**:
Both Gen 1 and Gen 2 doc have same error:
Gen 1: [Generate a download URL](https://docs.amplify.aws/gen1/javascript/build-a-backend/storage/download/#generate-a-download-url)
Gen 2: [Get or download file from a URL](https://docs.amplify.aws/javascript/build-a-backend/storage/download-files/#get-or-download-file-from-a-url)

Btw, not sure if it is better to set `useAccelerateEndpoint` to false in the sampl code otherwise user will experience a failure because of missign acceleration setup, or at least we can add a comment there to let user know it may fail.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.