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

How do I open .doc , .docx and image files from Amazon S3 using PHP?

This is my code:

$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.