php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35721 uploaded unicode filenames converts to underscore
Submitted: 2005-12-17 16:07 UTC Modified: 2005-12-17 21:25 UTC
From: omidmr at gmail dot com Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 5.1.1 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: omidmr at gmail dot com
New email:
PHP Version: OS:

 

 [2005-12-17 16:07 UTC] omidmr at gmail dot com
Description:
------------
When i upload a file with unicode filename (in my case, it is in Persian) PHP convert each character to an underscore sign (_).

for example when i upload a file, named "علی.php", it will convert to "___.php"

the written program works fine with PHP 5.0.5.

Regards,
omid

Reproduce code:
---------------
the very very simple code that i tested is:

<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file"><br>
<input type="submit" name="submit" value="submit">
</form>

<?php
    echo '<pre>';
    print_r($_FILES['file']);
    echo '</pre>';
?>

Expected result:
----------------
Array
(
    [name] => سلام.php
    [type] => application/octet-stream
    [tmp_name] => D:\php\tmp\php4D.tmp
    [error] => 0
    [size] => 0
)

Actual result:
--------------
Array
(
    [name] => ____.php
    [type] => application/octet-stream
    [tmp_name] => D:\php\tmp\php4D.tmp
    [error] => 0
    [size] => 0
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-17 16:24 UTC] tony2001@php.net
You have to wait for PHP6, Unicode support will be added only in this version.
 [2005-12-17 16:44 UTC] omidmr at gmail dot com
Thanks Tony,

but PHP supported unicode in uploading file functions. as i told, PHP 5.0.5 works fine.

the bug directly doesn't related to filesystem functions, because i don't write file on the disk.

Additional comments:
1- i tested it with 5.1.2-dev (current last release!) too.
and it has the bug too.

2- i tested it with 6.0.0-dev (current last release!) too.
and it has the bug too.

3- and again, this code, works fine [at least] with PHP 5.0.5
 [2005-12-17 19:54 UTC] omidmr at gmail dot com
sorry, i found it is bogus!
it is windows/firefox bug!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC