Sending a DOS COPY command - Problem - Access Denied!

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
johnali3n
Forum Newbie
Posts: 7
Joined: Tue Jul 19, 2005 9:16 am

Sending a DOS COPY command - Problem - Access Denied!

Post by johnali3n »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hey all,

I am trying to copy a file over the network to a local store, here is the functions:-

Code: Select all

function copyfile($filename)
{
	echo "Filename = ".$filename."<br />";
	$copyfile = `copy \\\\10.10.0.90\c\Batches\\$filename c:\Inetpub\wwwroot\autochecker`;

	echo "<pre>$copyfile</pre>";
	exit();
}
The $filename variable is fine but I get the following error output:-

"Access Denied"

..........

I tried the command from the host computer, this works - How can there be an authentication issue? Any help would be great.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

\\\\10.10.0.90\\c\\Batches\\$filename

By default the php script will run with the permissons of IUSR_machinename under the IIS. Does this account have the proper permissions to access the share? Or did you change the account settings?
Post Reply