02-21-2011 06:29 PM
Are there limitations as to where my program can download files to? I know my program has restrictions as to where it can write to but is there a difference with downloading? I want to download files from a server into my application's directory.
Solved! Go to Solution.
02-21-2011 06:42 PM
02-22-2011 10:57 AM
Noah, you asked about "where", but accepted John's answer which addressed only size limits.
As far as size limits go, I don't think we'll see any. Not any that a user can't override for your app, anyway. Some users might want a single app to have full access to available disk space.
We'll probably have some sort of "install manager" tool that lets us view and remove installed apps, as well as checking data size for each. Possibly a "clear temporary data" option as well, though the OS will do that automatically if it wants. (That would wipe the contents of the local /tmp folder for apps, probably just those that aren't running or active.)
As for "where", you have a few options.
You can write to File.applicationStorageDirectory, even creating subdirectories there, but only your own app can see the files in that location.
You can write to what would currently be accessible as File.userDirectory.resolvePath('tmp'), and that will act somewhat like the applicationStorage directory except as mentioned earlier the data could be wiped out by the OS whenever it wants to free up space (though possibly not while your app is active... none of that has been documented for us).
As for downloading... there should be no differences with downloading or any other form of data storage, other than perhaps the default 5MB limit on the size of SharedObject data (which, again, hasn't really been documented for us).