I'm trying to copy a file from one web server to another within our company. Someone else had a similar question here which was solved for them using the approach below.
However, when I try this I get the message "failed to open stream: Permission denied". The default login for the IIS web service is "Local System". Should I ask IT to assign a "network" login for this service, as they have suggested? Is there a better solution?
<?php
$from = "\\\\belqcdata01\\c$\\inetpub\\wwwroot\\productspecs\\certificate.pdf";
$to = "\\\\akudata01\\c$\\inetpub\\wwwroot\\productspecs\\certificate2.pdf";
if(!@copy($from, $to))
{
$errors= error_get_last();
echo "COPY ERROR: ".$errors['type'];
echo "<br />
".$errors['message'];
} else {
echo "File copied to remote!";
}
?>
Thanks, Kevin