0
我使用亚马逊S3 php来上传和下载文件。下载私人对象amazon s3 api
用于为例摆脱Amazon S3的私人文件,我使用的是:
// Cast the body to a primitive string
$bodyAsString = (string) $object['Body'];
和
public function getResponse($content, $filename, $length, $contentType)
{
$response = new Response();
$response->headers->set('Content-Description','File Transfer');
$response->headers->set('Content-Type',$contentType);
$response->headers->set('Content-Disposition','attachment; filename='.basename($filename));
$response->headers->set('Content-Transfer-Encoding','binary');
$response->headers->set('Expires','0');
$response->headers->set('Cache-Control','must-revalidate');
$response->headers->set('Pragma','public');
$response->headers->set('Content-Length',$length);
$response->setContent($content);
return $response;
}
下载它
但这是服务器很重,有没有解决方案直接从亚马逊s3使用链接下载私人对象,有点像公共对象与安全。
[Amazon S3上的隐私]的可能重复(http://stackoverflow.com/questions/20187441/privacy-on-amazon-s3) –