Question

Cannot access image uploaded using s3 api

Posted June 18, 2021 148 views
Node.js

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)
}
})
}

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.

×
Submit an Answer
1 answer

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