- This provider is a fork of AdamZikmund's strapi upload provider for Digital Ocean spaces.
This provider will upload to the space using the AWS S3 API.
- key : Space access key
- secret : Space access secret
- endpoint : Base URL of the space (e.g. 'fra.digitaloceanspaces.com')
- space : Name of the space in the Digital Ocean panel.
- directory : Name of the sub-directory you want to store your files in. (Optionnal - e.g. '/example')
- cdn : CDN Endpoint - URL of the cdn of the space (Optionnal - e.g. 'https://cdn.example.com')
- Install this package
npm i strapi-provider-upload-do
- Create config in
./extensions/upload/config/settings.js
with content
module.exports = {
provider: "do",
providerOptions: {
key: process.env.DO_SPACE_ACCESS_KEY,
secret: process.env.DO_SPACE_SECRET_KEY,
endpoint: process.env.DO_SPACE_ENDPOINT,
space: process.env.DO_SPACE_BUCKET,
directory: process.env.DO_SPACE_DIRECTORY,
cdn: process.env.DO_SPACE_CDN,
}
}
- Create
.env
and add to them
DO_SPACE_ACCESS_KEY
DO_SPACE_SECRET_KEY
DO_SPACE_ENDPOINT
DO_SPACE_BUCKET
DO_SPACE_DIRECTORY
DO_SPACE_CDN
with values obtained from tutorial:
https://www.digitalocean.com/community/tutorials/how-to-create-a-digitalocean-space-and-api-key
Parameter DO_SPACE_DIRECTORY
and DO_SPACE_CDN
is optional and you can ommit them both in .env
and settings
.