I a using the .Net AWSSDK. I am trying to upload an object with permissions. In the console you can set permissions on an object by object basis and I can't for the life of me work out how to do it in C#.
I want an uploaded object to have Oped/Download permissions for everybody. So far I have the following:
try
{
var fileTransferUtility = new TransferUtility(new AmazonS3Client(REGION));
var fileName = Path.GetFileName(filePath);
var key = path "/" + fileName;
fileTransferUtility.Upload(filePath, existingBucketName, key);
// Set open permissions for file with key
}
catch (AmazonS3Exception s3Exception)
{
Console.WriteLine(s3Exception.Message, s3Exception.InnerException);
}
Use this form of the
Upload
function:The
TransferUtilityUploadRequest
contains aCannedACL
property that can specify various different values such as: