I'm trying to run this code to copy file(s) from one server to another:
<?php
$from = '\\sxlsv-leapwebdv\c$\inetpub\wwwroot\leap\Deleteme.txt';
$to = '\\sxlsv-leapwebqa\c$\inetpub\wwwroot\leap\Deleteme.txt';
if(!@copy($from,$to))
{
$errors= error_get_last();
echo "COPY ERROR: ".$errors['type'];
echo "<br />
".$errors['message'];
}
else {
echo 'File copied from remote!<br />';
}
?>
Here is the error I'm getting:
COPY ERROR: 2
copy(/sxlsv-leapwebdv/c$/inetpub/wwwroot/leap/Deleteme.txt): failed to open stream: No such file or directory
The file DOES exist - when I navigate to that same path in Windows Explorer, I can access that directory and file.
Am I doing something wrong?