tinify / tinify-nodejs

Node.js client for the Tinify API.
https://tinypng.com/developers
MIT License
414 stars 74 forks source link

Overwrite existing file in S3 bucket #6

Closed that1guy closed 6 years ago

that1guy commented 8 years ago

Hello,

I'm uploading an image to S3 that already exists in my bucket

var bucketURL = "cdn.blah.com/profile-photo/" + body._id;

source.store({
          service: "s3",
          aws_access_key_id: config.aws_access_key_id,
          aws_secret_access_key: config.aws_secret_access_key,
          region: "us-west-1",
          path: bucketURL
        }, function(err){
          if(err) return done(err);
        });

This works perfectly the first time. If I do this a second time for the same user (which would result in the same filename) I receive no error but the image does not update in the s3 bucket.

Thanks for giving this a look.

rolftimmermans commented 8 years ago

Hi!

Thanks for reporting this. We have attempted to reproduce your issue but in all configurations we have tried the image is overwritten correctly.

If an error is returned by AWS, then this should be returned through our API to your Javascript code.

Your code certainly looks correct. Have you already attempted to temporarily store the input image as well, and verify that this is indeed updated?

Is it possible to overwrite the S3 image directly, without our API, but with the same credentials?