2015-09-10 58 views
0

我正在寫一個iOS應用程序在那裏我通過S3上傳圖片查看的ACL。我目前正在通過傳輸管理器使用預設的ACL來設置圖像上傳的ACL,如下面的代碼所示。從S3控制檯

//do the uploading using the AWS Transfer Manager so we can set the ACL 
_uploadRequest = [AWSS3TransferManagerUploadRequest new]; 
_uploadRequest.bucket = @"miltest"; 
_uploadRequest.ACL = AWSS3ObjectCannedACLPrivate; 
//key = the name of what the image is going to be called 
_uploadRequest.key = fileName; 
_uploadRequest.contentType = @"image.png"; 
_uploadRequest.body = url; 

圖像上傳罰款,但是當我查看對象的屬性我沒有看到設置ACL在此頁中指定:http://docs.aws.amazon.com/AmazonS3/latest/dev/manage-acls-using-console.html

我只能看到剷鬥所有者的政策。任何想法爲什麼沒有設置uploadRequest ACL?

我也注意到,新的傳輸工具似乎並沒有讓該應用上傳對象時設置ACL。是否支持ACL被刪除?

回答

0

這聽起來像它工作正常。擁有完全訪問權限的賬戶所有者和沒有其他額外的受讓人是您應該期望從AWSS3ObjectCannedACLPrivate得到的。

此外,與Amazon S3傳輸工具,你AWSS3TransferUtilityExpression使用- setValue:forRequestParameter:可以設置訪問控制列表。

+0

感謝您回覆。沒有意識到什麼時候它被設置爲私人,它不會顯示任何東西。 感謝上設置S3轉移實用ACL還幫助。 – trisha