Re: fopen and ftp
| From: | The Captain | Date: | Tue, 14 Nov 2000 21:17:05 +0000 |
| Subject: | Re: fopen and ftp | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25236@lists.php.net to get a copy of this message | ||
your best bet is to use the FTP functions that are available within PHP. In
order to get these, you'll have to recompile PHP and include the
"--enable-ftp" flag in your configure line.
check out http://www.php.net/manual/ref.ftp.php
for a list and description
of these functions
Good Luck
on 11/14/00 3:48 PM, Boget, Chris at Chris.Boget@wild.net wrote:
> Here is the command that I am using:
>
> fopen("Å„8�›á!›
> Mæ¥ð'ftp://...@ftp.sitename.com/hold_directory/filename.txt","r")
>
> When I run it in php, I get
>
> Warning:
> fopen("ftp://...@ftp.sitename.com/hold_directory/filename.txt","r")
> -
> No such file or directory in /absolute/path/to/controlling/php/script.php3
> on line X
>
> When I copy and past the above ftp command into my browser,
> (ie ftp://...@ftp.sitename.com/hold_directory/filename.txt)
> I get the error "the page cannot be displayed" error in IE (don't
> know what it would be in NS).
> When I remove the file name and try again, the directory's contents
> will get displayed. If I try the ftp command again, the file will
> miraculously
> pop up. Huh?
>
> Now, when I ftp in via the command line, I get dumped into the dir
> just below "hold_directory" making it so that I have to CD to
> "hold_directory" if I want to do anything to the files within so I don't
> think it is a path issue.
>
> Does anyone know what is going on?
>
> While I am on the subject, if I do eventually get this to work (hoping),
> is there a way to delete a file on a remote ftp server using PHP in a
> similar manner in which I read it (ie, the code above)?
>
> Thank you for your help!
>
> Chris