Simon Angell wrote:
> 
> Hi everyone.
> I asked this a week or so ago but i am unsure if it got to the list, so here
> we go again.
> 
> I am trying to get a remote file to be copied onto my own web server, I have
> looked at fopen() and fread() and fwrite() and get the general idea of each,
> but im wondering how to join the commandes to get the file i want from the
> remote ftp server, copied and written onto my own server.

Something like the following might work (not tested AT ALL):

$rContents = implode( "\n", file( 'ftp://www.foo.bar/me/my/data.txt' ) );

if( ($fp = fopen( '/tmp/myFile.txt', 'w+' )) !== false )
{
    fputs( $fp, $rContents );
    fclose( $fp );
}

-- 
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer  |
:----------------------------------------------:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109                 |
:----------------------------------------------:
| Website : http://www.webmotion.com           |
| Fax     : (613) 260-9545                     |
`----------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to