Upload filename with chinese

I found that some other zenphoto user complaint that.

At upload section, the uploader allow user to choose file with chinese filename, but it will strip the chinese out. As a result, if the filename is in chinese only, the file name on server only left the extension ".jpg", in case when the other chinese name file uploaded, it will overwrite each other.

I think it is better to have a warning when upload or generate a filename by checksum/random if the file only extension left.

Comments

  • acrylian Administrator, Developer
    If you mean the recent discussion about Cyrillic characters that and other UTF8 chars had been merged into the `filter-zenphoto_seo.php` in svn4771. We did of course not test Chinese characters (I actually also avoid special German characters in filenames to be sure they work). Maybe you can extend that plugin for Chinese chars? A warning is probably also a good idea.
  • Personally I also use ASCII only in filename and ftp the file to server :), I found that issue on someone's blog talk about zenphoto.

    I check the filter-zenphoto_seo.php, I think the concept is doing a character mapping? it should be a impossible task to do this on chinese... For seo, maybe just a urlencode is enough(or directly in Unicode?), Google can recognize my blog(wordpress) url contain chinese character.

    But the most frustration of current handling is the file overwrite problem, for a normal user it is difficult to them to know the filename after filtered, once a filtered filename match a file in same albums, the old file will be missing.
  • acrylian Administrator, Developer
    I guess you can agree that urlencoded file names look ugly (I am not talking of SEO, but readability for users to memorize..;-). You can just disable the filter then it should be urlencoded and the filename not be cleared.

    I see that character mapping might be impossible with Chinese or other non European characters. Please open a ticket so that we don't forget this for 1.2.9 (we are in translation string/feature freeze actually as you know).
  • Ticked created.

    Disable the filter is same, seem that seoFriendly function handle it if the filter did not.

    Agree that the urlencoded filename is look ugly. so may just store the file as it is, and only doing urlencode on anchor link. Firefox & Safari can interpret it on address bar (IE can't).
  • acrylian Administrator, Developer
    The `seoFriendly` function actually it has been renamed to `filterAccentedCharacters()` and that is the filter.
  • If the plugin is disabled you get a bare bones filtering which removes non-ascii alphanumeric characters. To allow Chineses characters requires either a special plugin or changes to the current one.
Sign In or Register to comment.