|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7860 pb with copy($source,$dest) when $dest point on network disk
Submitted: 2000-11-17 03:45 UTC Modified: 2001-06-21 23:41 UTC
From: benoit dot martin at alcatel dot fr Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.3pl1 OS: Windows NT
Private report: No CVE-ID: None
 [2000-11-17 03:45 UTC] benoit dot martin at alcatel dot fr

I have an Apache Server and PHP 4.0.3pl1 installed on WindowsNT.
I am trying to make the following script work
The pb is when the destination file is on c:\dir\$Fichier_dest it works
but when i use a virutal letter F:\ that point on a network computer,
the answer is unable to create file 'myfile' : permission denied !
and when a try the same thing in a MS-DOS window (copy c:\myfile.txt
f:\myfile.txt) it works !!!!!
does anyone can help me ????

the script :


 if ($Fichier && $Fichier != "none") {

 echo "<U><B>Votre fichier :</B></U><BR>";
 echo "Fichier sur serveur : $Fichier<BR>";
 echo "Fichier envoy?      : $Fichier_name<BR>";
 echo "Taille              : $Fichier_size<BR>";
 echo "Type                : $Fichier_type<BR>";
 $Fichier_dest = "f:\\".$Fichier_name;

 if (!copy($Fichier, $Fichier_dest)) {
       print ("failed to copy $Fichier_dest <br>\n");
  echo "$php_errormsg";
      } else {
  print ("$Fichier_dest copi?...");


<FORM ENCTYPE="multipart/form-data" METHOD="POST">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000">
Envoyer le fichier : <INPUT NAME="Fichier" TYPE="file">
<INPUT TYPE="submit" VALUE="Envoyer le fichier">


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-17 04:06 UTC]
When you copy file in the dos window, you do so with the permissions of whoever you logged on as. When PHP does it, it probably does it as IUSR_MACHINENAME - which may not have permission to access the network drive.

Can you check your permissions and report back.
 [2000-11-17 09:37 UTC]
I've exchanged a few emails and it does seem that NY access permissions are ok - 'Everyone' has 'full control' on the shared drive.

Any other ideas anyone?
 [2000-11-23 07:36 UTC]
reclassify - this has nothing to do with PHP networking.
 [2001-06-03 01:14 UTC]
Does this happen with PHP 4.0.5? And fyi, UNC support is 
added in PHP 4.0.6..

 [2001-06-21 23:41 UTC]
No feedback. Reopen if this doesn't work with PHP 4.0.6
(which is released today)

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 17:01:31 2024 UTC