如果我尝试打开放置在空中app文件夹内的文件,我只会收到"错误#3000:非法路径名称".如果文件位于app-folder之外的其他位置,则可以使用.
private var file:File = File.documentsDirectory;
public function download():void{
var pdfFilter:FileFilter = new FileFilter("PDF Files", "*.pdf");
file.browseForOpen("Open", [pdfFilter]);
file.addEventListener(Event.SELECT, fileSelected);
}
private function fileSelected(e:Event):void
{
var destination:File = File.applicationDirectory
destination = destination.resolvePath("test.pdf");
/*
//This works, also if the file to copy is placed inside the appfolder
file.copyTo(destination, true);
*/
/*This Throws me an Error #3000, but ONLY if the file is located in
the App folder*/
file.openWithDefaultApplication();
}
Run Code Online (Sandbox Code Playgroud)
当我尝试获取相同的文件并将其复制到另一个地方时,它做得很好.
为什么?如果我想打开appfolder中的文件,可以做些什么特别的事情?它也不能在调试模式下工作 - bin-debug.
此致,Temo