如何更新AWS S3存储桶上传的文件权限?

时间:2015-02-09 07:22:32

标签: node.js amazon-s3

我使用node.js使用Multipart Upload将视频上传到Amazon-S3。我正在使用this参考

默认情况下,上传的视频只能由所有者访问。

使用以下代码上传文件时

var params_to_upload_on_S3 = {                     ACL:' public-read',                     斗:imageBucket,                     密钥:imgName +" .jpg",                     身体:imageBuffer,                     ContentType:'图片/ jpg'                 }

        s3.putObject(params_to_upload_on_S3 , function (err, res) {
            if(err)
                console.log('Thumnail Upload Error'+ err);
            else 
                console.log('Thumbnail Successfully uploaded .'+ JSON.stringify(res));

            fs.unlink(imagePath, function(){
                console.log('File deleted from local storage');
            });

        });

0 个答案:

没有答案