PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Upload » Bug #6094

Missing file name

Details

Submitted2005-11-28 12:30 UTC
Fromsilence dot vincent at msa dot hinet dot net
StatusNo Feedback
PackageHTTP_Upload
PHP Version5.0.5
OSWin XP
Roadmaps(Not assigned)

Comments

[2005-11-28 12:30 UTC] silence dot vincent at msa dot hinet dot net

Description:
------------
If I upload the file with Chinese-word file name,

for example: xxx.zip, xxx means Chinese words

After uploading, I will only get .zip in result.
miss the file name but file extension.

I already find out the reason of missing file name in method &_buildFiles():

function &_buildFiles(){
....
....
$name = basename($value['name']);
....
....
}

basename() function causes this problem.

Test script:
---------------
$upload = new http_upload();
$file = $upload->getFiles('userfile');

echo '<pre>';

print_r($_FILES);

print_r($file->getProp());

echo '</pre>';

Expected result:
----------------
Array
(
[userfile] => Array
(
[name] => ¤å¥ó.doc
[type] => application/msword
[tmp_name] => C:\PHP\tmp\php30.tmp
[error] => 0
[size] => 10752
)

)
Array
(
[real] => ¤å¥ó.doc
[name] => ¤å¥ó.doc
[form_name] => userfile
[ext] => doc
[tmp_name] => C:\PHP\tmp\php30.tmp
[size] => 10752
[type] => application/msword
[error] =>
)

Actual result:
--------------
Array
(
[userfile] => Array
(
[name] => ¤å¥ó.doc
[type] => application/msword
[tmp_name] => C:\PHP\tmp\php30.tmp
[error] => 0
[size] => 10752
)

)
Array
(
[real] => .doc
[name] => .doc
[form_name] => userfile
[ext] => doc
[tmp_name] => C:\PHP\tmp\php30.tmp
[size] => 10752
[type] => application/msword
[error] =>
)