Home » HTTP » HTTP_Upload » Bug #7861
Filenames with spaces in them get their names changed when being moved
Details
| Doc Bug #7861 | Filenames with spaces in them get their names changed when being moved |
|---|---|
| Submitted | 2006-06-11 02:40 UTC |
| From | pear dot bugtrack at telus dot net |
| Assigned | cweiske |
| Status | Closed |
| Package | HTTP_Upload |
| PHP Version | Irrelevant |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-06-11 02:40 UTC] pear dot bugtrack at telus dot net
Description:
------------
HTTP_Upload_File::moveTo() calls HTTP_Upload_File::setName('safe') by default, resulting in the following bug for files that are uploaded with spaces in the name and subsequently moved.
Test script:
---------------
$file = $http_Upload->getFiles('Filedata');
$file->getProp("name"); // "my file.jpg"
$file->moveTo("myFiles/");
$file->getProp("name"); // "my_file.jpg"
Temporary solution:
$file = $http_Upload->getFiles('Filedata');
$file->setName('safe');
$file->getProp("name"); // "my_file.jpg"
Expected result:
----------------
This is far from being a bug, there just needs to be better documentation for the moveTo() method, or alternatively setName('safe') needs to be called from within getFiles().