Skip to main content
Participant
March 11, 2013
Question

browseForOpen, browseForSave can't open custom directory

  • March 11, 2013
  • 3 replies
  • 1502 views

hi,

i have a very simple air application that just asks the user to select a file and then opens a dialog to save the file.

The problem that I have is that the browseForOpen dialog doesn't start in the directory specified by the File object. Here's the code:

protected function button1_clickHandler(event:MouseEvent):void     {

var siteRoot : String = 'file:///D|/sites/Unnamed Site 45/';

var siteFile : File = new File(siteRoot);

  siteFile.addEventListener(Event.SELECT, function(e:Event) {

       var selectedFile : File = e.target as File;

       var dest : File = new File(siteRoot);

       dest = dest.resolvePath(selectedFile.name);

       dest.browseForSave('Select where to save the file');

  });

siteFile.browseForOpen('Open file');

}

Tested from Flex environment it works fine. When you click the button the OS browse dialog is opened inside the file:///D|/sites/Unnamed Site 45/ folder.

However, once i export the release build, install the application and test again, the browse dialog is always opened in the last folder that I was inside. Not the specified folder.

I believe this happens since I made the update to latest AIR version.

Any help ? Thanks

This topic has been closed for replies.

3 replies

Participant
September 3, 2013

Definitely a big problem, I need to point user to a directory inside the application storage directory. On many popular OS it is nontrivial to find, to say the least.

chris.campbell
Community Manager
Community Manager
September 3, 2013

I'm touching base with one of our developers that worked in this area recently, but as far as our bug database goes, this should be fixed in AIR 3.8.  Which releases are you testing against?

Participant
October 6, 2014

Excellent, thanks for the update.


I've never seen this working on a Mac with an HTML AIR app. It always just defaults to the last open/save directory.

Participant
June 19, 2013

Same issue here-

Participant
June 19, 2013

browseForDirectory has the same issue. Seems 3.6 of AIR (and whatever version of Flash that was) introduced this problem. And boy is it a problem!