Re: Reading a file from another server

From: Date: Sat, 26 Jul 2003 00:09:32 +0000
Subject: Re: Reading a file from another server
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156966@lists.php.net to get a copy of this message
--- Thomas <zaxisnet@hotmail.com> wrote: > > readfile("ftp://username:password@server.somedomain.com/test.txt"); > > It doesn't have any errors and comes up blank. > > If I put: > > $result = > > readfile("ftp://username:password@server.somedomain.com/test.txt"); > print ($result); > > it ends up showing a '0' by iteself. The readfile() functions outputs the contents of the file and returns the size of the file in bytes. So, when you assigned $result to the return value, you demonstrated that readfile() output 0 bytes (which explains why you didn't see anything). I'm pretty sure your php.ini is set to allow this, otherwise you would receive an error. I'm doubting whether that URL actually contains any content. How have you tested to be sure it does? Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/

« previous php.general (#156966) next »