how to upload same name file to amazon s3 and overwrite exist file

前端 未结 2 2047
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 11:01
    s3.putObject({
        Bucket: bucketName,
        Key: fileName,
        Body: file,
        ACL: \'bucket-owner-full-control\'
    }, function(err, data) {
      i         


        
2条回答
  •  鱼传尺愫
    2021-02-05 11:40

    I guess you've encountered the default caching mechanism which is 24 hours, this results in not receiving the latest stored object. To override this, add parameter to putObject():

    CacheControl: "no-cache" or Expires: new Date()

提交回复
热议问题