note 70841 deleted from function.fopen by bjori

From: Date: Fri, 08 Dec 2006 07:19:14 +0000
Subject: note 70841 deleted from function.fopen by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-120423@lists.php.net to get a copy of this message
Note Submitter: admin AT dlyaza DOTcom ---- 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); } ?>

« previous php.notes (#120423) next »