2017-02-21 59 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中指定文件類型。對於圖像,您可以使用Content-type:image/jpeg –