Copyinf Files from Remote IP |
3/18/2024 4:50:56 PM |
PHPRunner General questions | |
J
JoeB7774 author
Hello. I am trying to copy a files from a remote host to my localhost using a button. I have the Server Code as follows but it always seems to fail (I have changed the IP to all zeros). The remote IP does not need authentication. I have allso changed the source directory to "http://00.00.00.00/Lists/MATERIAL.txt" and that also fails. I was just wondering if anoyone can see what I might be doing wrong? I have also tried fopen, file_get_contents but neither seems to work (doesn't produce an error). I have verified that php.ini on localhost has allow_url_fopen is On. Thanks in advance. Joe. $source = '\00.00.00.00\Lists\MATERIAL.txt'; if(!copy($source, $destination)){ |
|
C
|
cristi 3/19/2024 |
The copy method doesn't always works: behind a firewall, large files corruption, etc Better yet use a free library from the web - leave the hassle of writing code for creating ftp connections and downloads to others who were dedicated on this and just concentrate on your application. or this one: |
admin 3/19/2024 | |
You cannot "copy" files from an IP address. You can download files from a remote computer/server via HTTP or FTP and then save them somethere on a local drive. So, instead of trying copy() function, download and them move them to the required folder. |