PHP Tutorial File Download instance
Here is mainly the use of PHP fopen function to implement a read file to send to the customer locally, there is a need for friends to refer to.
Set_time_limit (24*60*60);
if (!isset ($_post[' submit ')) Die ();
$destination _folder = './down/'; Folder to save the downloaded file. Must end with a slash
$url = $_post[' url '];
$newfname = $destination _folder.basename ($url);
$file = fopen ($url, "RB");
if ($file) {
$NEWF = fopen ($newfname, "WB");
if ($NEWF) while (!feof ($file)) {
Fwrite ($NEWF, Fread ($file, 1024*8), 1024*8);
}
}
if ($file) {
Fclose ($file);
}
if ($NEWF) {
Fclose ($NEWF);
}
?>
http://www.bkjia.com/PHPjc/444753.html www.bkjia.com true http://www.bkjia.com/PHPjc/444753.html techarticle php Tutorial File Download Example here is mainly the use of PHP fopen function to implement the reading of the file sent to the local customer, there is a need for friends to refer to. Form method=post input na ...