AWS SDK file uploading

I’m using storj(with aws sdk) for storage, may I know what is the “Key” parameter in it?

(async () => { // file can be a readable stream in node or a Blob in the browser const params = { Bucket: “my-bucket”, Key: “my-object”, Body: file }; await s3.upload(params, { partSize: 64 * 1024 * 1024 }).promise(); })();

Hello @akanksha.t05,
Welcome to the forum!

it’s a “path to the file”. I.e. if your object is s3://my-bucket/prefix/image.png, then the bucket will be my-bucket, the key is prefix/image.png.
If you store it without a prefix(es), then the key would be just image.png.

Basically it’s the name of the file. I implemented it yesterday and set the filename (eg image_2022.png).
I didn’t test if the image (key) already exists it overwrites the current image with the new one or keeps both.
But I recommend putting the filename with a unique id or mixing it with timestamp