Closed iksinski closed 1 year ago
@iksinski
403 Error as it suggests is The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.
So are you sure if the endpoint provided has complete access for the upload. Also in the above example if I can understand correctly the PUTOBJECT request is being called via the URL being constructed.
Can you try the above request using the PUT Object request as shown in the example.
function createTextFile(bucketName, itemName, fileText) {
console.log(`Creating new item: ${itemName}`);
return cos.putObject({
Bucket: bucketName,
Key: itemName,
Body: fileText
}).promise()
.then(() => {
console.log(`Item: ${itemName} created!`);
logDone();
})
.catch(logError);
}
Thanks.
@arnabm28 thanks for your response. We've been using PUSH instead of PUT in the frontend - that's why we couldn't upload files... Sorry for not checking thoroughly before posting! Btw, it would be great to have docs for this for nodejs as well :)
Thanks for the confirmation. Here is the S3 API Documentation link : https://ibm.github.io/ibm-cos-sdk-js/AWS/S3.html
The overall API documentation : https://ibm.github.io/ibm-cos-sdk-js/
Hey all, I'm having problems with uploading files with presigned url, I'm using HMAC keys generated via cli and code to generate url as follows:
Uploading files is done by a regular html form using this url, unfortunately it results in 403 error,
There were headers present in the request which were not signed
and header mentioned ishost
. What am I doing wrong...?