Load Binary via FTP

From: Date: Mon, 23 Oct 2000 10:00:31 +0000
Subject: Load Binary via FTP
Groups: php.general 
Request: Send a blank email to php-general+get-21761@lists.php.net to get a copy of this message
Hiho ! I load a binary over ftp with: $pass = rawurlencode($this->pass); $file = "ftp://".$this->user.":".$pass."@".$this->host."/".$this->path."/".$this->filename; $fp = fopen($file, "r"); while (!feof ($fp)) { $buffer = fgetc($fp); // Do someting with $buffer } fclose($fp); But it seems to be very slow to get the file char-by-char. I tried $buffer = fgets ($fp, 4096*2); but then the file is NOT loaded completly, it stops after 1 to 5 KB (the file is about 100 KB). Why ? Whats the best and fastest way to load a binary file via ftp ? Regards Martin

« previous php.general (#21761) next »