readfile("ftp://....");

From: Date: Fri, 10 Aug 2001 04:18:02 +0000
Subject: readfile("ftp://....");
Groups: php.general 
Request: Send a blank email to php-general+get-62106@lists.php.net to get a copy of this message
will the readfile() function not accept a user/pass combination in an ftp url? like: readfile("ftp://user:pass@host.com/path/to/file"); I get two errors. The first is a file not found error. The second is a No Such file or directory error. droppoing the user:pass section works just fine. Here's the code: $ftp_server_path = "ftp://$ftpuser:$ftppass@$ftphost/$ftppath/"; $i = $QUERY_STRING; $url = $ftp_server_path.$leech_name[$i]; $filename = explode("/", $leech_name[$i]); // start downloading file Header("Content-Type: application/octet-stream"); Header("Content-Length: ".filesize($url)); Header("Content-Disposition: attachement; filename=$filename[1]"); header("Pragma: no-cache"); header("Expires: 0"); readfile($url); I've also tried going the fopen(), fread() route with the same result. Any ideas what I'm doing wrong? or if it's even possible? Thanks, David Minor

« previous php.general (#62106) next »