my AIR app is a desktop application, maybe should not have too much safe request.
now i need let download happen automatically without popup a window. i know FileReference class discribed it can't set a default folder, but anyway i think there must be a way could resolve this problem, such as every 60 seconds download a pic whithout click and browse to put it to where. this can't happened on internet app yes, but is that true can't happened on a desktop app?
if even it really can't achieve such a goal, is there a way like as use FileStream to write byte data to local to be a file or someway else? i just expect it could been used these ways to write to pic or flv files
expect the answers or clues
Air runtime based native applications are already *within* user security box - once their are deployed somehow - e.g. by inernet based downloads and then installed. Some restrictions that apply flash.filesystem.FileReference do not apply to class that extends it: flash.filesystem.File - because it is run in desktop sandbox - not web/browser sandbox. For example action to save/load/browser, etc - won't be requring user interaction to be started - you would also have feature in flash.filesystem.File that allows you to not ask about location where content is to be saved - but construct that paths at runtime using File class properties and methods.
Your assumption about download routine is correct, in Air simply:
- get bytes into application
- create File object reference
- open FileStream
- write stream to File.
E.g. for exact example see that snippet from Adobe's page:
(details for File/FileStream are in docs),
Thanks a lot, I use URLLoader to load plus FileStream to write it's working greatly.