PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Upload » Bug #7861

Filenames with spaces in them get their names changed when being moved

Details

Doc Bug #7861Filenames with spaces in them get their names changed when being moved
Submitted2006-06-11 02:40 UTC
Frompear dot bugtrack at telus dot net
Assignedcweiske
StatusClosed
PackageHTTP_Upload
PHP VersionIrrelevant
OSLinux
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().