PHPにリモートサーバーからファイルをダウンロードさせてローカルフォルダーに保存させることは可能ですか?
編集
これが重複した質問だとは知りませんでした。投稿する前に検索しましたが、「phpが自動的にファイルをダウンロードする」を検索していて、ブラウザにファイルを開かずに強制的にダウンロードさせる方法についての結果を得ていました。
<?php
// set url "http://
curl_setopt($ch, CURLOPT_URL, "<your url>");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
file_put_contents($output,"<file>";
?>
を使用しfile_get_contents
ます。