以下のようにAWS SDK for PHPを使い
S3にアップロードしたコンテンツを表示したいのですが
うまくいきません
$bodyの中身はfopen($file['filename']['tmp_name'],'rb')となっております
拡張子の無いファイルは落ちてきて実際の画像と同じサイズなのですが
拡張子をjpgのように元に戻しても破損しているといわれます
どこが原因なのかご教示ください
実際のAWSコンソールで確認すると画像でダウンロードできます
public function sendTempFile($filename,$body,$file){ $result = $this->s3->putObject(array( 'Bucket' => 'bucket', 'Key' => $this->tempDirectry.$filename, 'Body' => $body, //'ContentType' => mime_content_type($file['filename']['tmp_name']), )); $result = $this->s3->getObject(array( 'Bucket' => 'bucket', 'Key' => $this->tempDirectry.$filename, )); header("Content-Type: {$result['ContentType']}"); echo $result['Body']; exit(); }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。