Skip to main content
Participant
Mar 11, 2013 6:45 PM UTC
Question

browseForOpen, browseForSave can't open custom directory

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 is closed to new replies. Start a new post to keep the conversation going.

7 replies

Participant
Sep 3, 2013 9:08 AM UTC

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.

Translate
chris.campbell
Legend
Sep 3, 2013 6:58 PM UTC

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?

Translate
Participant
Sep 5, 2013 2:12 PM UTC

As of vesion 3.8, this sure seems to work again!

Translate
Participant
Jun 19, 2013 5:29 PM UTC

Same issue here-

Translate
Participant
Jun 19, 2013 3:28 PM UTC

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!

Translate