logo

New Response

« Return to the main article

You are replying to:

    • avatar
    • Michael
    • Posted on Fri 18 May 2007

    Hi, another good idea is to check for "ugly" characters in the filename that prevent the attachment from being able to be opened. "Ugly" means non-english characters.

    Just encode the filename (means: translate to unicode) and check if it is the same as the original. But don't care about spaces.

    // replace a space with something harmless var file_nameC = file_name.replace(/ /g, "a"); if (encodeURIComponent(file_nameC) != file_nameC) error_feld = error_feld +'\n\t Characters found in filename not suitable for webaccess!';

    Michael

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: