0
votes

I'm using URLStream to load a file from the harddisk (and I'd like to continue to use URLStream to do so). The file is located in "app-storage:/myfolder/myFile.zip"

so I use

var f:File = new File("app-storage:/myfolder/myFile.zip");
myStream.load(new URLRequest(f.nativePath));

on Windows this seems to work without problems - but on OS X the URLStream dispatches a SecurityErrorEvent.SECURITY_ERROR with the message:

Error #2032: Stream Error. URL: app:/Users/myUserName/Library/Preferences/MyAppName/Local%20Store/myfolder/myFile.zip

can someone explain me why this works on windows but not on OS X and how to resolve this issue?

1

1 Answers

0
votes

Good old, ambiguous error 2032!

You might want to try:

var f:File = new File(File.applicationStorageDirectory + "/myFolder/myFile.zip");

EDIT

My original comment was to use the File.applicationStorageDirectory property, and I still think that's a good idea. But it looks like that property boils down to the same string that you are using ... so perhaps the problem is that the location of the storage dir has changed and the file you are looking for is still in the original location? See link below.

End Edit

Note the comment here about a change made to this path in Air 3.3 for Mac OSX only. Even if this doesn't fix your problem, using this property should shield your code from future problems if the path changes or a different "schema" is needed for some other device/OS.