Problems copying a file to a network drive

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rcatal02
Forum Newbie
Posts: 1
Joined: Thu Aug 09, 2007 9:03 am

Problems copying a file to a network drive

Post by rcatal02 »

I have been having problems trying to copy a file over to a network drive using PHP 4.3.6

Any help is appreciated.

I have tried both of these methods below

$localFile = 'c:\temp\test.txt';
$remoteFile = 'e:\temp\test.txt';

if (!copy($localFile, $remoteFile))
{
echo "php copy failed";
}
echo "<br>";
$sysCommand = "copy $localFile $remoteFile";
echo $sysCommand;

system($sysCommand, $retval);
echo "<br>System copy result = $retval";
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

rcatal02 wrote:I have been having problems trying to copy a file over to a network drive using PHP 4.3.6
please describe the problem, in more detail, including the error/warning messages if there are any.
e: is a network share mapping?
Post Reply