当Flex端下载带有中文文件名文件时,会出现错误,无法正常下载,解决办法是:
/**
* 本地保存文件需要携带文件名
* 该方法主要解决URL中携带有中文字符而导致IOErorr的问题,而且默认文件名必须为中文才可以解决问题
**/
public static function downLoadFilesByFileName(urlAdd:String, defaultFileName:String = null):void
{
//必须先encodeURI
downloadURL = new URLRequest(encodeURI(urlAdd));
DownLoadfile = new FileReference();
configureListeners(DownLoadfile);
DownLoadfile.download(downloadURL, defaultFileName + ".xml");
}