Download file from S3 via frontend or backend link

System Information
  • Strapi Version 3.6.8:
  • OSX:
  • SQLite:
  • Node Version v14.15.5:
  • NPM Version:
  • Yarn Version:

So I have the upload plugin storing the public URL’s of the s3 objects im looking to download via React frontend app. Anybody have any solutions to append the content-disposition header or create a link that automatically downloads? Also , the old element with download href trick doesn’t seem to work because of CORS.


Hi, you can set the ContentDisposition in your s3 setting (plugins.ts)

    upload: {
      config: {
        provider: 'aws-s3',
        providerOptions: {
          accessKeyId: 'aaa',
          secretAccessKey: 'aaa',
          region: 'eu-central-1',
          endpoint: 'https://aaa,
          params: {
            Bucket: 'strapi-dev/assets',
            ContentDisposition: 'attachment'
          },
        },

        actionOptions: {
          upload: {},
          uploadStream: {},
          delete: {},
        },
      },
    },