如何使用PHP从Amazon S3打开.doc,.docx和图像文件?

时间:2015-12-27 11:52:13

标签: php amazon-s3

如何使用PHP从Amazon S3打开.doc,.docx和图像文件?

这是我的代码:

$objInfo = $s3->getObjectInfo(BUCKETNAME, 'n77yrSahsahfdghasfdh.doc');
$obj = $s3->getObject(BUCKETNAME, 'n77yjgsahfdghasfdh.doc');

header('Content-Type: ' .  $objInfo["type"]);

header('Content-Disposition: attachment; filename=teetetet');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
echo $object->body;

This code is not working
let me know how to open the doc ,docx and image file from amazon s3.

0 个答案:

没有答案