2017-02-21 3 views

答えて

1

この方法を試してください。

<?php 
if(isset($_POST('btnDownload'))) 
{ 
    $fileurl = 'your full path of s3 here'; 
    header("Content-type:application/pdf"); 
    header('Content-Disposition: attachment; filename=' . $filename); 
    readfile($fileurl); 
} 
?> 
+0

はい!まさに私が必要とするもの。ありがとうございました。これはすべてのファイルタイプで機能しますか? – CloudSeph

+0

Content-typeにファイルタイプを指定する必要があります。 imageの場合、Content-type:image/jpegを使用できます –

関連する問題