Skip to content

Backblaze setup example to direct upload (CORS) #4

@antoniosmgatto

Description

@antoniosmgatto

Hi There !!!

First of all, Thanks for this integration !

I'm facing some CORS trouble with B2 and I appreciate any help.

I can't setup my bucket to upload files from my frontend (React-app). I am using this gem with Active Storage to generate the direct upload url.

This is the command I use to setup the CORS rules:

b2 update-bucket --corsRules '[
    {
        "corsRuleName": "downloadFromAnyOriginWithUpload",
        "allowedOrigins": [
            "*"
        ],
        "allowedHeaders": [
            "*"
        ],
        "allowedOperations": [
            "b2_download_file_by_id",
            "b2_download_file_by_name",
            "b2_upload_file",
            "b2_upload_part"
        ],
        "exposeHeaders": [
            "authorization",
            "x-bz-file-name",
            "x-bz-part-number",
            "x-bz-content-sha1"
        ],
        "maxAgeSeconds": 3600
    }
]' my-bucket allPublic

Any idea?

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