Skip to content

403 forbidden #51

@alkun-org

Description

@alkun-org

I ran into this error today trying to use this library with DigitalOCean Spaces.
error: Uncaught (in promise) S3Error: Failed to put object: 403 Forbidden

My code as below

import { S3, S3Bucket } from "https://deno.land/x/s3@0.5.0/mod.ts";

const s3 = new S3({
    accessKeyID: cfg.key,
    secretKey: cfg.secret,
    region: 'us-east-1',
    endpointURL: 'nyc3.digitaloceanspaces.com',
});

const bucket = s3.getBucket('myspace');

const fileName = '/tmp/about.json';
const text = await Deno.readTextFile(fileName);

const result = await bucket.putObject('about.json', text, {
    contentType: "application/json",
    acl: "public-read"
});

I've enabled CORS, set headers to '*' , enable all methods etc. I don't have issue accessing Spaces, just this API. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions