Question

Cannot access image uploaded using s3 api

I’am going to use the DO’s Space as an alternative of AWS S3. After uploading the image using node.js, I tried to access it from browser, but it shows your connection is not private.

Code Shared here

const uploadImage2DOS3 = async (body, extension, nftItem) => { let fileName = generateFileName() let params = { Bucket: artionBucket, Key: ${fileName}.${extension}, Body: body, ACL: ‘public-read’, Metadata: {}, } s3.putObject(params, (err, data) => { if (err) { console.log(err, err.stack) } else { console.log(data) } }) }


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello @Jason0119 ,

Since you using the application code to upload the file to Spaces, we will need to see if it uploaded or not.

How exactly are you trying to access the file ? Can you once share the URL, which will help us to try it on our end.

In order to dig in more, we request you to open a ticket to our customer support team, who can access your account and provide some insights.

https://www.digitalocean.com/support/

Hope this helps!

Cheers, Sri Charan