Problem with $_FILES['userfile']['name'] and IE
Posted: Mon Jan 31, 2005 4:40 pm
I have been having an issue lately with file uploads behaving differently under different browsers. I the problem originally showed itself in phpBB, however it is not restricted to its use.
When a file is uploaded and stored in php's temp folder the filename, size, etc is saved in the $_FILES['*']['*'] array. The issue I am having is that $_FILES['userfile']['name'] is not showing the same data from browser to browser, more specifically:
Using IE (6.0.2900.2180.xpsp_sp2_rtm.040803-2158):
$_FILES['userfile']['name'] -> C:\Documents and
Settings\User\Desktop\image.jpg
Using Firefox (1.0):
$_FILES['userfile']['name'] -> image.jpg
I had recently updated to a dev version of PHP (4.3.11-dev) because of a bug in the current version (4.3.10) while trying to compile in the GD library from an external source. Because of that update I attributed the error to the dev version of PHP and submitted a bug report to php ( http://bugs.php.net/bug.php?id=31757 ). PHP then told me it was a bug in IE and to report it to them.
My question is, has this error shown up anywhere else? If so, what version of php and IE where you using? I'm guessing I can solve it by parsing the filename reported by IE and removing everything before the last slash..?
Andrew
When a file is uploaded and stored in php's temp folder the filename, size, etc is saved in the $_FILES['*']['*'] array. The issue I am having is that $_FILES['userfile']['name'] is not showing the same data from browser to browser, more specifically:
Using IE (6.0.2900.2180.xpsp_sp2_rtm.040803-2158):
$_FILES['userfile']['name'] -> C:\Documents and
Settings\User\Desktop\image.jpg
Using Firefox (1.0):
$_FILES['userfile']['name'] -> image.jpg
I had recently updated to a dev version of PHP (4.3.11-dev) because of a bug in the current version (4.3.10) while trying to compile in the GD library from an external source. Because of that update I attributed the error to the dev version of PHP and submitted a bug report to php ( http://bugs.php.net/bug.php?id=31757 ). PHP then told me it was a bug in IE and to report it to them.
My question is, has this error shown up anywhere else? If so, what version of php and IE where you using? I'm guessing I can solve it by parsing the filename reported by IE and removing everything before the last slash..?
Andrew