Flex FileReference prohibited characters -
Flex FileReference prohibited characters -
the utilize of filereference has constraint on valid characters. error: error #2087: filereference.download() file name contains prohibited characters.
fine since guess restriction comes underlying file scheme anyway is there such things generic way trim / replace prohibited characters? clarity after like: var dirty:string = "eat !@##$%%^&&*()\/";.txt
var clean:string = dirty.replaceallprohibitedcharacters();
not looking os specific regular expressions, cross platform solution.
the list of disallowed characters not alter depending on underlying os, fixed list. documentation filereference.download()
list of disallowed characters is:
/\:*?"<>|%
edit: looks @
isn't allowed either.
if want remove characters arbitrary string can this:
var validfilename:string = invalidfilename.replace(/[\/\\:*?"<>|%@]/g, "");
if want replace them else, alter sec parameter replace()
.
edit: added @
character; escaped /
character.
flex filereference
Comments
Post a Comment