You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bucket that has all public access blocked, and my policy (copied from a tutorial as I'm new to AWS and not super familiar with this stuff) that looks like this (some values edited for potential security concerns):
I have a next.js site that has api routes which allow me to upload files from the server in one route, and retrieve the files in another route. The code to upload works successfully and looks like this:
Then in the frontend, the url returned above can be called with a PUT fetch request and I can upload the file.
However, when I try to create a presigned url that allows a user to view the file, I get an issue I'm not sure how to resolve. A url is being generated without error, but it doesn't work. This is what that code looks like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a bucket that has all public access blocked, and my policy (copied from a tutorial as I'm new to AWS and not super familiar with this stuff) that looks like this (some values edited for potential security concerns):
I have a next.js site that has api routes which allow me to upload files from the server in one route, and retrieve the files in another route. The code to upload works successfully and looks like this:
Then in the frontend, the url returned above can be called with a PUT fetch request and I can upload the file.
However, when I try to create a presigned url that allows a user to view the file, I get an issue I'm not sure how to resolve. A url is being generated without error, but it doesn't work. This is what that code looks like:
Am I missing something? My credentials are set properly and I can tell they work because the upload works, but not the downloading.
Beta Was this translation helpful? Give feedback.
All reactions