is it posible to copy the file in the web servergoing to my local computer? instead of downloading it. example: copy('http://some.com/file.txt', 'c:\file.txt'); PHP:
No, I don't think that's possible. You will need to download the file first, put it in a variable, and then copy it to your pc. Im not sure if php has a download function, but if they have, you can probably point to the download directory in one step, and you wouldn't need to use the buffer.
yeah virus like, but that is not my intension, i'm just want to mirroring the my site which my file stored then going to my intranet program. to be automatically copy the file in someones folder. if they posible i want drag and drop basis.
The following php code should do the trick: $url ="www.TARGETDOMAIN.com"; $page = "/page.html"; $fp = fsockopen("$url", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET $page HTTP/1.0\r\n"; $out .= "Host: $url\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $printThis .= fgets($fp, 128); } fclose($fp); } echo $printThis; $handle = fopen( "copy.html", "w"); fwrite( $handle, $printThis); Code (markup):