By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,212 Members | 2,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,212 IT Pros & Developers. It's quick & easy.

copy()-problem over a network

P: n/a
Hello,
I have a problem with accessing files on other computers in my network.
The network is a Windows 2000 workgroup network and I have administrator
rights....

This works (from the directory copytest I copy something to copytest2):

<?php
copy('05_17340.jpg', 'D:\\copytest2\\test.jpg');
?>

The next bit does not do the job (from the same directory to a networked
one):

<?php
copy('05_17340.jpg', 'V:\\copytest2\\test.jpg');
?>
It gives me the following message:
Warning: copy(V:\copytest2\test.jpg): failed to open stream: Permission
denied in D:\localweb\copytest\copytest.php on line 2
(\\\computername\\sharename gives the same message).

Any thoughts on this?
Thanks,
Marcel


Jan 2 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Marcel" <in**@nospam-bluegumdata.com.au> wrote in message
news:43******@duster.adelaide.on.net...
Hello,
I have a problem with accessing files on other computers in my network.
The network is a Windows 2000 workgroup network and I have administrator
rights....

This works (from the directory copytest I copy something to copytest2):

<?php
copy('05_17340.jpg', 'D:\\copytest2\\test.jpg');
?>

The next bit does not do the job (from the same directory to a networked
one):

<?php
copy('05_17340.jpg', 'V:\\copytest2\\test.jpg');
?>
It gives me the following message:
Warning: copy(V:\copytest2\test.jpg): failed to open stream: Permission
denied in D:\localweb\copytest\copytest.php on line 2
(\\\computername\\sharename gives the same message).

Any thoughts on this?
Thanks,
Marcel


A small addition:
Replacing the copy command with exec('copy d:\localweb\copytest\*.*
v:\copytest2\*.*' ) doesn't work either. When I issue the same command from
the DOS-prompt (copy d:\localweb\copytest\*.* v:\copytest2\*.*), it works...
Why, why, why?
Jan 2 '06 #2

P: n/a

"Marcel" <in**@nospam-bluegumdata.com.au> wrote in message
news:43******@duster.adelaide.on.net...
"Marcel" <in**@nospam-bluegumdata.com.au> wrote in message
news:43******@duster.adelaide.on.net...
Hello,
I have a problem with accessing files on other computers in my network.
The network is a Windows 2000 workgroup network and I have administrator
rights....

This works (from the directory copytest I copy something to copytest2):

<?php
copy('05_17340.jpg', 'D:\\copytest2\\test.jpg');
?>

The next bit does not do the job (from the same directory to a networked
one):

<?php
copy('05_17340.jpg', 'V:\\copytest2\\test.jpg');
?>
It gives me the following message:
Warning: copy(V:\copytest2\test.jpg): failed to open stream: Permission
denied in D:\localweb\copytest\copytest.php on line 2
(\\\computername\\sharename gives the same message).

Any thoughts on this?
Thanks,
Marcel

A small addition:
Replacing the copy command with exec('copy d:\localweb\copytest\*.*
v:\copytest2\*.*' ) doesn't work either. When I issue the same command

from the DOS-prompt (copy d:\localweb\copytest\*.* v:\copytest2\*.*), it works... Why, why, why?

Maybe this helps: the local webserver runs with Apache 2.0.55 (Win32) and
PHP 4.4.1
Jan 2 '06 #3

P: n/a
"Marcel" <in**@nospam-bluegumdata.com.au> wrote in message
news:43******@duster.adelaide.on.net...

"Marcel" <in**@nospam-bluegumdata.com.au> wrote in message
news:43******@duster.adelaide.on.net...
"Marcel" <in**@nospam-bluegumdata.com.au> wrote in message
news:43******@duster.adelaide.on.net...
> Hello,
> I have a problem with accessing files on other computers in my network.
> The network is a Windows 2000 workgroup network and I have
> administrator
> rights....
>
> This works (from the directory copytest I copy something to copytest2):
>
> <?php
> copy('05_17340.jpg', 'D:\\copytest2\\test.jpg');
> ?>
>
> The next bit does not do the job (from the same directory to a
> networked
> one):
>
> <?php
> copy('05_17340.jpg', 'V:\\copytest2\\test.jpg');
> ?>
> It gives me the following message:
> Warning: copy(V:\copytest2\test.jpg): failed to open stream: Permission
> denied in D:\localweb\copytest\copytest.php on line 2
> (\\\computername\\sharename gives the same message).
>
> Any thoughts on this?
> Thanks,
> Marcel
>


A small addition:
Replacing the copy command with exec('copy d:\localweb\copytest\*.*
v:\copytest2\*.*' ) doesn't work either. When I issue the same command

from
the DOS-prompt (copy d:\localweb\copytest\*.* v:\copytest2\*.*), it

works...
Why, why, why?

Maybe this helps: the local webserver runs with Apache 2.0.55 (Win32) and
PHP 4.4.1

The web server runs with different user rights than you as the admin. You
need to grant the same rights to the web server user, so it has permission
to write to the network drive. Maybe create a new account on the network
drive for the server. I don't know about apache, but IIS servers username is
usually something like IUSR_<COMPUTERNAME>, like IUSR_WEB or IUSR_SERVER or
whatever... That user role needs to have access to the remote filesystem
too.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Jan 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.