如何在flex3和actionscript 3中获取上传文件的完整合格路径

发布于 2024-11-10 09:38:25 字数 466 浏览 4 评论 0原文

比如说,用户通过 AIR 应用程序创建了一个 xml 文件,并且该文件已保存在其计算机的某个位置。如果用户在该应用程序中第二次输入,则应显示该 XML 文件的内容而不提示他。应用程序应静默读取文件并显示内容。

在这种情况下,我认为当用户保存该文件时,整个文件位置将保存在 cookie 中。如果用户在该应用程序中第二次输入,则可以从 cookie 中获取文件路径。不会提示用户。

这是以下代码段:

var _refFile:FileReference = new FileReference();
var newXMLStr:String = "this is a problem"; 
_refFile.save(newXMLStr,"abc.xml");

如何获取已保存文件的完整限定路径?

可以实施吗?如果是这样,请帮助我。我在这个问题上坚持了很长时间。如果不可能,请提供任何替代的合适解决方案。

say, user created a xml file by an AIR application and this file has been saved in certain location of his machine. If user enters second time in that application, the content of that XML file, should be displayed without prompting him. application should read file silently and display the content.

In this scenario, i thought that when user will save that file, the entire file location will be saved in cookie. If user enters second time in that application, the file path will be available from cookie. user will not be prompted.

This is the following code segment:

var _refFile:FileReference = new FileReference();
var newXMLStr:String = "this is a problem"; 
_refFile.save(newXMLStr,"abc.xml");

How can I get that full qualified path of saved file ?

is it possible to implement? if so, please please help me out. I stuck to this problem for long days. If it is not possible then please provide any alternative suitable solutions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷乱花海 2024-11-17 09:38:26

不要使用 FileReference,而是使用 File:

var file:File = new File();
file.save(xml, 'abc.xml');
trace(file.nativePath);

Instead of using FileReference, use File:

var file:File = new File();
file.save(xml, 'abc.xml');
trace(file.nativePath);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文