note 70841 added to function.fopen
| From: | adminATdlyazaDOTcom at osu1 dot php dot net | Date: | Tue, 31 Oct 2006 11:20:08 +0000 |
| Subject: | note 70841 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119266@lists.php.net to get a copy of this message | ||
I want to download files directly to my Host, Instead of Uploading file, Uoloading it directly Like
webcopy, I have this script ( simple for explanation) but its not work properly, Can anyone explain
this case for me
code
<?PHP
$fileurl=$_POST['fileurl'];
$filename=$_POST['filename'];
$destination="/home/usr/upload/".$filename;
if(!empty($fileurl) && !empty($filename)){
$fp = @fopen($fileurl, 'rb');
$contents = "";
do {
$data = fread($fp, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while (true);
fclose($fp);
$tp = @fopen($destination, 'wb');
fwrite($tp, $contents);
fclose($tp);
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 207.226.41.21
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- https://master.php.net/note/edit/70841
Del: integrated -- https://master.php.net/note/delete/70841/integrated
Del: useless -- https://master.php.net/note/delete/70841/useless
Del: bad code -- https://master.php.net/note/delete/70841/bad+code
Del: spam -- https://master.php.net/note/delete/70841/spam
Del: non-english -- https://master.php.net/note/delete/70841/non-english
Del: in docs -- https://master.php.net/note/delete/70841/in+docs
Del: other reasons-- https://master.php.net/note/delete/70841
Reject -- https://master.php.net/note/reject/70841
Search -- https://master.php.net/manage/user-notes.php