locked
Best Practice For Application Data Storage Location

    Question

  • Hello,

    I'm working on a Windows Store Apps and following the MSDN documentation I'm not sure about the best way to store my application data for the following scenario:

    1. The application should be delivered to the user, already populated with a single folder structure.

    2. The user should be able to connect to an online source and synchronize the previous files collection.

    3. files reading and updating should be handled programmatically (without using a FilePicker).

    I have tried to use the application's installed location, but it seems that my app cannot create files (Access Denied).

    I also tried the Downloads folder where I can create new files, but I get an Access Denied message when I try to read from this location.

    Regards

    Saturday, May 10, 2014 5:31 PM

Answers

  • Yes. That is the purpose for the app data directories.
    • Marked as answer by StergiosIs Sunday, May 11, 2014 9:16 AM
    Saturday, May 10, 2014 11:15 PM
    Owner

All replies

  • Store it in your application data folders. See Accessing app data with the Windows Runtime (Windows Runtime apps)

    For scenario 1 you can include the data in the apps package and copy it to the app data folders on first run.

    For scenario 2, if you have small amounts of data you can use the built in roaming system. For large dada sets ou'll need to set up your own cloud service.

    Saturday, May 10, 2014 5:52 PM
    Owner
  • Thank you Rob for your swift answer.

    For scenario 1 you mean to include the data in the visual studio project and then copy them from

    Windows.ApplicationModel.Package.Current.InstalledLocation to

    Windows.Storage.ApplicationData.Current.LocalFolder on the first run?

    Do I have read/write access to the LocalFolder programmatically?

    Saturday, May 10, 2014 8:57 PM
  • Yes. That is the purpose for the app data directories.
    • Marked as answer by StergiosIs Sunday, May 11, 2014 9:16 AM
    Saturday, May 10, 2014 11:15 PM
    Owner