|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-04 00:20 UTC] lobo235 at gmail dot com
Description: ------------ The full name of the file is not put into the $_FILES[] array when a file is uploaded that has an apostrophe in the name. For example: lobo235's fam.jpg The first part of the filename including the apostrophe is cut off so it shows as: s fam.jpg I am using $_FILES['userfile']['name'] to try and get the original file name when I see this. Reproduce code: --------------- <?php echo "<h2>".$_FILES['userfile']['name']."</h2>"; ?> <form method="post" action="p.php" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="7000000" /> Attach this file: <input name="userfile" type="file" size="32" /><br />(<i>Max Size: 7 Megabytes</i>)<br /> <input type="submit" name="attach" value="Attach" /> </form> Expected result: ---------------- The full name of the file uploaded including the apostrophe. Actual result: -------------- The first part of the filename is cut off including the apostrophe. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 18:00:01 2025 UTC |
If I remember correctly, PHP used to handle filenames of this type just fine. I know that other scripting languages are able to handle these types of filenames just fine. Is there any way that this can be implemented in a future version? It seems like if an array element is going to be set to the "original" file name it should work all the time or not at all. It is misleading when one reads the documentation concerning Handling file uploads. It says: $_FILES['userfile']['name'] The original name of the file on the client machine. To me this says that no matter what they've named their file this array element always gets set to the name of the file on the client machine. Maybe a change is needed in the documentation.