Upload to digitalOcean Space

default discord avatar
thefrontend
10 months ago
2

I'm trying to upload media into a digitalOcean space using the

plugin-cloud-storage

. However, I always get the error

region is missing

. Manually adding the region won't solve it, I guess the URL will just be wrong then. Maybe anyone solved this already?

  • discord user avatar
    dribbens
    Payload Team
    10 months ago

    digitalOcean's storage is supposed to be S3 API compliant. There was a community released plugin for s3 uploads that I tested with DO sometime last year. I am pretty confident this should work with the cloud-storage-plugin.


    All I can say is this

    should

    be possible.

  • default discord avatar
    thefrontend
    10 months ago

    Ok, I figured it out.



    For everyone having the same problem: You need to prepend

    https://

    to your endpoint and add

    region

    the same way it's specified in your endpoint.



    Example:

    adapter: s3Adapter({ config: { endpoint: 'https://fra1.digitaloceanspaces.com', region: 'fra1', credentials: { accessKeyId: <DO_KEY>, secretAccessKey: <DO_SECRET>, }, }, bucket: <DO_BUCKET_NAME>, }),
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.