Skip to main content
Inspiring
November 4, 2013
Question

File.preventBackup Not Working

  • November 4, 2013
  • 1 reply
  • 1026 views

I posted about this in the AIR Development forum originally thinking I'm probably not implementing it correctly, but after more and more testing I do not think this is working correctly. I have a Flex mobile app that I'm trying to store downloaded content into a subdirectory of the File.applicationStorageDirectory, and I've created a global variable in the main mxml class that initiates this location and sets it's preventBackup property to true. Now later on in other mxml views in the application, I'm referencing the variable using FlexGlobals.topLevelApplication.cachedXmlDir and in some cases FlexGlobals.topLevelApplication.cachedXmlDir.resolvePath("en") to write to subdirectories. When debugging on the iPad device, it seems that after the first reference to this global variable, it's preventBackup property gets set back to false. Also when I test this using iCloud backup, it is indeed backing up my downloaded content. So I don't see that there's anything with my code that would cause this, it just looks like this property is not being "sticky" at all. I also logged this as a bug, but would like any insight of others on this.

https://bugbase.adobe.com/index.cfm?event=bug&id=3657771

This topic has been closed for replies.

1 reply

Adobe Employee
November 5, 2013

Can you attach a sample to demonstrate the problem and elaborate the problem you are facing?

As far as I understand, you are using a global variable to a location that does not exists on disk and you are setting its preventBackup property to true. In case you are using the same variable to write files on the disk, it should set the preventBackup property appropriately.

leejkAuthor
Inspiring
November 5, 2013

I can't post a workin sample because the server I'm downloading from is internal to our network, but I could email you the code, it's 3 mxml files and not that complicated.

Adobe Employee
November 6, 2013

You can mail me the sample project at vabhatia[at]adobe.com