php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5375 File upload problems
Submitted: 2000-07-05 15:29 UTC Modified: 2001-04-28 23:33 UTC
From: michael dot eisele dot me at bayer-ag dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: Windows NT 4.0 SP5
Private report: No CVE-ID: None
 [2000-07-05 15:29 UTC] michael dot eisele dot me at bayer-ag dot de
Scripts that used the file upload fuction via HTTP form worked fine in PHP3. Now file upload misbehaves in Version 4.01 as follows:

1. The variable userfile[] contains double backslahes in file names (e.g. c:\\temp\\php2, should be c:\temp\php2).
This Bug has already been reported.
2. If the bug in userfile[] is fixed by a regular expression replace the file cannot be copied anyway. A call to copy( $userfile[0], $dest) fails. The file referenced in $userfile[0] is present in the temp dir. The same script worked in PHP 3.
3. The script/PHP does not delete the temporary file with the form data in the temp dir. The uploaded file are deleted in the temp dir correctly.

Thanks for any help.

Michael Eisele

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-05 16:00 UTC] michael dot eisele dot me at bayer-ag dot de
Scripts that used the file upload fuction via HTTP form worked fine in PHP3. Now file upload misbehaves in Version 4.01 as follows:

 1. The variable userfile[] contains double backslahes in file names (e.g. c:\\temp\\php2,
 should be c:\temp\php2).
 This Bug has already been reported.
 2. If the bug in userfile[] is fixed by a regular expression replace the file cannot be
 copied anyway. A call to copy( $userfile[0], $dest) fails. The file referenced in
 $userfile[0] is present in the temp dir. The same script worked in PHP 3.

Thanks for any help.

 Michael Eisele
 [2000-07-05 16:01 UTC] michael dot eisele dot me at bayer-ag dot de
I deleted Problem 3 reported: The file left in the temp dir comes from Netscape running on the same machine, not from PHP. Sorry.
 [2000-07-06 10:55 UTC] michael dot eisele dot me at bayer-ag dot de
I analysed the problem again:
Problem no 2 is caused by  UNC paths: the copy($userfile, $dest) function fails if $dest is a UNC path (\\servername\somedir\file.txt). This worked fine in PHP 3. Does PHP4 not support UNC paths ?

 [2000-07-27 21:08 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version from CVS or snaps.php.net.
 [2000-08-20 02:46 UTC] sniper@php.net
No feedback from user.

--Jani
 [2000-08-21 02:38 UTC] joey@php.net
User reported to list:
If two things work now (single backslahes instead of double; UNC paths) the bug would be resolved. I will confirm that when the next binary release will be available.

Can someone on Win32 please check to see in UNC works:
A) At all in latest CVS
B) For copy() specfically

If so, we can eliminate 2.
I'll see if I can look into 1.

 [2000-11-03 20:51 UTC] sniper@php.net
In #6554 Stas commented:

Actually, I guess nothing is working with UNC pathes in PHP. Windows file naming schemes suck very badly.
 [2001-04-28 23:33 UTC] sniper@php.net
This is fixed in CVS.
The UNC paths will work with PHP 4.0.6.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 00:01:30 2024 UTC