我正在使用KnpGaufretteBundle在 Amazon S3 上存储图片,我可以使用以下代码轻松创建一个文件:
public function s3CreatFileAction(Request $request) {
$filesystem = $this->get('knp_gaufrette.filesystem_map')->get('profile_photos');
$filesystem->write('test.txt', 'hello world');
[...]
}
问题是我无法访问该文件...
$filesystem = $this->get('knp_gaufrette.filesystem_map')->get('profile_photos');
$file = $filesystem->get('test.txt');
我收到以下消息:
找不到文件“test.txt”。
我认为这是因为“test.txt”文件是使用“私有”acl 创建的(当我通过 S3 控制台将其公开时,我可以访问它)。
所以我的问题是如何在创建对象时定义公共 acl?