RE: [PHP] Copying file to a network drive (in WinNT4)
| From: | Joe Kaiping | Date: | Thu, 27 Sep 2001 19:29:30 +0000 |
| Subject: | RE: [PHP] Copying file to a network drive (in WinNT4) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69038@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Ville Mattila [mailto:ville.mattila@pilotmedia.fi]
> Sent: Thursday, September 27, 2001 11:10 AM
> To: joe.kaiping@home.com; php-general@lists.php.net
> Subject: Re: [PHP] Copying file to a network drive (in WinNT4)
>
> > Also, make sure that you have permission to create/modify
> the $dest file.
>
> Should be, because I can copy the file via "normal way" in Windows....
>
>
Hi again,
Not sure what you're up against. I searched http://www.php.net to confirm
h:\file is the correct Windows file system syntax to use. Seems to be.
Also there is no mention of copy() not working on windows, (except for when
using a sharename instead of a mapped drive name. (But you're using a mapped
drive name, h))
The apache daemon on unix runs under the permissions of a certain system
user, usually "nobody". Not sure how NT does it, but if it also runs under
a specific user, maybe that user doesn't have permission to write to the
file?
However, the version of PHP I'm running gives a "Permissions" error message
when it doesn't have permission to write to the file. You got the following
error instead, but I'm not sure about the behavior of PHP on windows, maybe
a different error message is output when you don't have permission.
Warning: Unable to create 'h:\redhouse.jpg': Invalid argument in
c:\apache\htdocs\copypic.php on line 14
Anyway, I was unable to reproduce the "Invalid argument" error on Unix. I
would doubt that there in a bug with copy() for Windows without it already
appearing on the PHP site. So I'd guess that it is caused because PHP
doesn't like the format of the contents of either $src or $dest. I'd suggest
going over those again with a magnifying glass. It sounds like you already
have, though, so I'm out of thoughts for right now.
Sorry for not being able to help any more. Best of luck!
-Joe