Closed (fixed)
Project:
FileField
Version:
6.x-3.0-alpha5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2008 at 07:39 UTC
Updated:
9 Apr 2009 at 21:10 UTC
If the file name is wide char like Chinese, it's renamed to "pdf". information display like:
"For security reasons, your upload has been renamed to pdf.."
If the "Permitted upload file extensions" is set. The file can't be uploaded, and information display like:
"The selected file pdf. could not be uploaded. Only files with the following extensions are allowed: pdf."
Another question:
Should uuid be used for file names in the future?
Comments
Comment #1
dopry commentedI need more information to help you with this issue...
Can you upload the original file or link to it somewhere so I can test it... Are you on windows or linux. I know for sure the php file functions for win32 do no support unicode. I'm not sure about linux, I think it may depend on how your system is set up... I'd love an update as i18n is an issue oft over looked in file handling.
.darrel.
Comment #2
shenzhuxi commentedI've fixed it.
In fact, it's due to Drupal core and Php default settings rather than FileField module.
In the unicode.inc file, "setlocale(LC_CTYPE, 'C')" is the the default setting. I fixed this problem by changing it into "setlocale(LC_CTYPE, 'en_US.UTF-8')".
Comment #3
quicksketchYou might also try using transliterate module, which can convert non-latin characters in filenames when saving on servers that do not support UTF-8 characters. Thanks for letting us know your solution.
Comment #4
mirian commentedIsn't it too general place to change that encoding definition?
I wonder if it may cause problems in other places...
I think , maybe there is a use of some PHP function that does not supportnon latin languages..
see the problem described here http://drupal.org/node/278425 regarding to "basename" in Drupal5 ...
Miriam