Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello to all, I’m completely new to Digital Ocean and to cloud storage in general, but even following step by step this tutorial I get the error mentioned in the title. I think that it’s is related to the fact that I’m not authenticated correctly, but I really don’t know why.
The important bits of code are this:
import fs from "fs";
import { S3, PutObjectCommand } from "@aws-sdk/client-s3";
const s3Client = new S3({
endpoint: "https://fra1.digitaloceanspaces.com",
region: "fra1",
credentials: {
accessKeyId: process.env.SPACES_KEY,
secretAccessKey: process.env.SPACES_SECRET,
},
});
and this:
const fileContent = await new Promise((resolve) =>
fs.readFile("output.webp", (err, data) => resolve(data))
);
try {
const data = await s3Client.send(
new PutObjectCommand({
Bucket: "name-of-bucket",
Key: "test.webp",
Body: fileContent,
})
);
console.log(
"Successfully uploaded object: " +
bucketParams.Bucket +
"/" +
bucketParams.Key
);
return data;
} catch (err) {
console.log("Error", err);
}
I followed the steps to generate the API keys to access the Space and then I stored them in a .env file, as per this. But I’m not setting anything else, maybe I should, I really don’t know. The SDK version is 3.54.0. Any help would be much appreciated
SarkariResultht
KFSys
Arne van Hoorn
alexdo
4287c71658bd4ea39bef277d491b1c
4287c71658bd4ea39bef277d491b1c
Demanix
Demanix
devjk1
Jordan
LC Labs Sp. z o.o.
a0cd9be01b14447384f79073fc121f