Skip to content

403 forbidden #51

Open
Open
@alkun-org

Description

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/[email protected]/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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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