我只收到一封错误#3000:非法路径名称如果我尝试打开它放置在空气中的应用程序文件夹中的文件。如果该文件是别处应用程序文件夹它工作的外部。
I'll ONLY recieve an "Error #3000: Illegal path name" if I try to open a file which is placed inside the app-folder of the air. If the file is somewhere else outside of the app-folder it works.
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();
}
当我试图得到相同的文件,并将其复制到另一个地方,它做得很好。
When i try to get the same file and copy it to another place it's doing fine.
为什么呢?一些特别的东西做的,如果我想打开的文件,这是appfolder里面? 它也不会在调试模式下运行 - 滨调试
Why that? Something special to do if i wanna open files which are inside the appfolder? It also don't work in debug mode - bin-debug.
问候,特莫
阅读文档几次我看到了,这是不可能的后(这是不是一个错误,这是一个功能!?!)
After reading the document a few times i saw that this is not possible (it's not a bug, it's a feature!?!)
Opening使用默认系统应用文件
您无法与位于应用程序目录中的文件使用openWithDefaultApplication()方法。
You cannot use the openWithDefaultApplication() method with files located in the application directory.
所以,我这样做,而不是:
So I do this instead:
file.copyTo(tempFile);
tempFile.openWithDefaultApplication();
不是很好,但它的作品。
Not so nice, but it works.