私のプロバイダはfopen()を許可していません。だから私はこれを使わずにファイルをダウンロードした。しかし、サーバーのタイムアウトとメモリの制限のために、これは小さいファイル(< 100MB)に対してのみ機能します。 大きなファイル(1GB)をダウンロードする必要があります。fopen()を使わないで大きなファイルをダウンロードしますか?
大きなファイルをダウンロードする別の方法はありますか?
$file = $_GET['dateiUrl'];
//set header
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-Type: application/force-download');
header("Content-Transfer-Encoding: binary");
header("Content-Disposition: attachment; filename=" . basename($file));
//curl part
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_URL, $file);
$data = curl_exec($ch);
curl_close($ch);
//output
echo $data;
http://php.net/manual/en/function.ftp-get.php - FTP ?? –
バックグラウンドタスクとしてexec() 'wget'を実行することができます。これにより、PHPのコントロールから(ほとんどの)転送が行われます。 –