问题
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