How to open and Write specified file in flex web app?

别说谁变了你拦得住时间么 提交于 2019-12-24 07:15:27

问题


In webApp. I want to create file in users desktop with some name and I want to write into it How to do this? is it possible using File reference?

Filereference.save() method i tried but it opens dialog box for saving, but i want file to be save in given path without opening dialog box.


回答1:


From a browser based Flash app; you cannot save a file to the users machine in Flex without user input. FileREference.save() is the correct approach, but as you discovered it opens a dialog box for user input.

Depending what information you need to store; a local Shared Object may work. Adobe has some good documentation on using Shared Objects:

  • https://learn.adobe.com/wiki/display/Flex/Shared+Objects
  • http://livedocs.adobe.com/flex/3/html/help.html?content=lsos_5.html
  • http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html
  • http://livedocs.adobe.com/flex/3/html/help.html?content=lsos_2.html


来源:https://stackoverflow.com/questions/12889515/how-to-open-and-write-specified-file-in-flex-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!