
November 19th, 2001, 10:05 AM
|
|
Junior Member
|
|
Join Date: Mar 2001
Location: Cardiff, Wales
Posts: 10
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
accesing a file using ftp
Hi,
I want to be able to open a file for reading via ftp and I am using the command...
PHP Code:
$file_lines = file("ftp://username:passwd@intranet/R1234.txt", "r");
But it fails with the message - No such file or directory in /home/web6508/intranet.... on line 28.
If I copy the command 'ftp://username:passwd@intranet/R1234.txt' into internet explorer it opens the file so I know the location of the file is correct. Also I have tried it on two different ftp clients - latest version of wu-ftpd and slightly older solaris version. I know that the manuals says that it only works with passive ftp but shouldn't wu-ftpd should be OK? (it even says 'entering passive mode when you log in!) Is there something that I need to enable in php (allow_url_fopen is On in php.ini) or is there any further info I might be able to get to find out why its failing? I am using php4.0.4pl1-3.
Thanks
Rich
|