Upload success with DO space but never show

I’m using DO space for the first time to upload images and documents. I used multer and multer-s3 to upload multiple images. The function works fine and show successful without error. But DO space doesn’t show any updates. The files doesn’t upload to the DO space. I tried URL but no such key.

I set my DO Space:

  • Enable File Listing
  • Enable CDN
  • CORS: allow all the wildcard domain
const bucket = 'MY_DO_UNIQUE_NAME';
const spacesEndpoint = new AWS.Endpoint('');
const s3 = new AWS.S3({
        endpoint: spacesEndpoint,
        accessKeyId: process.env.DO_ACCESS_KEY,
        secretAccessKey: process.env.DO_SECRET_KEY

const upload = multer({
      storage: multerS3({
        bucket: bucket,
        acl: 'public-read',
        key: function (request, file, cb) {
          cb(null, file.originalname);

}).array('file', 100);

upload(req, res, function (error, file, data) {
          if (error) {
            return response.redirect("/error");
          console.log('File uploaded successfully.');

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Same problem! Impossible upload a file with DO Space., but same code works on my AWS S3.

Help please…

Hello! I’m having a similar problem but in my case I get the return above but my files are unreadable in spaces. I use the AWS api.


I’m sorry about the trouble this is causing for you. My concern is that perhaps your code is not putting out an error, but that this may not be a clear indication that our server has actually accepted the upload. Are you able to fully output the response from our server when you upload the object? Here’s an example of what a successful response might look like to a PUT:

HTTP/1.1 200 OK

Date: Mon, 10 Jul 2017 19:46:06 GMT
x-amz-request-id: tx0000000000000027bd57c-005963d97e-1268c-nyc3a
Content-Length: 0
Accept-Ranges: bytes
Last-Modified: Mon, 10 Jul 2017 19:05:09 GMT
Etag: "fb08934ef619f205f272b0adfd6c018c"
Connection: close