Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download files demo code has syntax error #7490

Open
hangoocn opened this issue May 6, 2024 · 2 comments
Open

Download files demo code has syntax error #7490

hangoocn opened this issue May 6, 2024 · 2 comments

Comments

@hangoocn
Copy link

hangoocn commented May 6, 2024

Describe the content issue:
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
Gen 2: 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.

@aspittel
Copy link
Contributor

aspittel commented May 6, 2024

Thanks for filing this! Added to the PR here: #7489

@hangoocn
Copy link
Author

hangoocn commented May 6, 2024

Thanks @aspittel, I was looking at syntax error in these 3 lines:

options: {
    validateObjectExistence?: false,  // [error:] extra question mark
    expiresIn?: 20 //  [error:] extra question mark, no comma
    useAccelerateEndpoint: true; //  [error:] comma instead of semi-colon
  }

I just added comment for each line error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants