ID:               32349
 User updated by:  zamorov at edinorog dot ru
 Reported By:      zamorov at edinorog dot ru
-Status:           Bogus
+Status:           Open
 Bug Type:         Filesystem function related
 Operating System: FreeBSD
 PHP Version:      php4-STABLE-200503181130
 New Comment:

Sample. I'm upload file from windows to unix.

$_FILES[etc]['name'] contain path with backslash, but basename
understand only forward slash.

Use
$imageName =& array_pop(split('/', strtr($_FILES['image']['name'],
array('\\' => '/'))));
rather than
$imageName =& basename($_FILES['image']['name']);
wise choice?


Previous Comments:
------------------------------------------------------------------------

[2005-03-18 15:08:24] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Qutiong php.net/basename 
 
"On Windows, both slash (/) and backslash (\) are used as 
directory separator character. In other environments, it is 
the forward slash (/)." 

------------------------------------------------------------------------

[2005-03-18 14:41:29] zamorov at edinorog dot ru

That problem remained open.

------------------------------------------------------------------------

[2005-03-17 09:34:06] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

[2005-03-17 09:28:13] zamorov at edinorog dot ru

Description:
------------
basename not work correctly with windows path

Reproduce code:
---------------
$win = basename('C:\Windows\win.ini');
$unix = basename('/usr/local/etc/win.ini');

Expected result:
----------------
$win = 'win.ini';
$unix = 'win.ini';

Actual result:
--------------
$win = 'C:\Windows\win.ini';
$unix = 'win.ini';


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32349&edit=1

Reply via email to