I am trying to upload a file to digital ocean spaces while sending the request with axios but I get an error '<?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidArgument</Code><RequestId>tx000000000000005d0d942-0063c03ce7-2bb535ec-sfo3a</RequestId><HostId>2bb535ec-sfo3a-sfo3-zg01</HostId></Error>'
I am convinced this is because I might be using the wrong details in axios headers. Here is my axios headers.
const headers = {
"Content-Type": mimeType,
Authorization: `Bearer ${TOKEN}`,
"secret-key": API_KEY,
"x-amz-acl": "public-read",
};
I generate Spaces-access keys and I got two keys secret and another one that is in CAPS. I assumed the one in caps is Token and secret is the api key but I still I got that error.
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!
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.
Hi there,
I would personally suggest using the
@aws-sdk/client-s3
JavaScript SDK to interact with Spaces. Here is a quick snippet:Let me know how it goes!
Best,
Bobby