Downloading File via PHP
Moderator: General Moderators
-
aicfan4@yahoo.com
- Forum Newbie
- Posts: 1
- Joined: Mon Jul 25, 2005 1:49 am
Downloading File via PHP
I've found some examples of how to upload a file via PHP, for instance: http://us2.php.net/features.file-upload, however I need to be able to download a file from a server using PHP. Does anyone have a good tutorial page to point me to, or offer any suggestions on this subject? Thanks.
Yes, use
Code: Select all
header()Or did he want to do this?
Code: Select all
<?
$file="http://example.org/files/data.zip";
$data=file_get_contents($file);
$h = fopen ("/example/path/data.zip", "w");
fwrite($h, $data);
fclose($h);
?>