kristianto adi widiatmoko wrote:
i try to transfer file from one server to another server, lets call it server A 
to server B.

My Idea is like this I place my script in server A

<?php
$local = fopen("file.txt","r");
$remote = fopen("http://B/file.txt","w+);

while(!feof($local)) {
    $buff = fread($local,1024);
    fwrite($remote, $buff);
}

fclose($local);
fclose($remote);

?>

Is Any one has sugestion about it, or another method ??

You can't write files to a remote server through a web server like this.

The php page (http://php.net/fopen) has an example of what you want:

$handle = fopen("ftp://user:[EMAIL PROTECTED]/somefile.txt", "w");

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Reply via email to