473,382 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

copy()-problem over a network

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
3 2896
"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

"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
15
by: A | last post by:
Hi, A default copy constructor is created for you when you don't specify one yourself. In such case, the default copy constructor will simply do a bitwise copy for primitives (including...
5
by: Tony Johansson | last post by:
Hello! I'm reading in a book about C++ and that is something that sound strange. It says "Pointers have reference-assignment semantics similar to those in Java. For example, after the...
2
by: Alex | last post by:
Entering the following in the Python shell yields >>> help(dict.copy) Help on method_descriptor: copy(...) D.copy() -> a shallow copy of D >>>
8
by: Jesper | last post by:
Hi, Does the concept "copy constructor" from c++ excist in c#. What is the syntax. best regards Jesper.
7
by: Richard Forester | last post by:
Hello. I need some help understanding what goes on when an array is copied. I create 2 arrays and copy one to the other: int pins = {9, 3, 7, 2}; int copy = new int; for (int i = 0; i !=...
24
by: rdc02271 | last post by:
Hello! Is this too crazy or not? Copy constructor: why can't I copy objects as if they were structs? I have a set of simple objects (no string properties, just integers, doubles) and I have to...
12
by: Mark E. Fenner | last post by:
Hello all, I have a code where my inner loop looks like: allNew = for params in cases: newObj = copy(initialObject) newObj.modify(params) allNew.append(newObj) return allNew
8
by: shuisheng | last post by:
Dear All, I am wondering how the default copy constructor of a derived class looks like. Does it look like class B : public A { B(const B& right) : A(right) {}
3
by: maheshkadam | last post by:
Hi friends I am new to perl so please guide me. I have one application which created backup log file every day.But it appends that file so you can see logs for different day in one file only. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.