locked
Reading files in a windows store app RRS feed

  • Question

  • Hi,

    I am trying to read a file in a  windows store app, I get the access denied error, which can overcome by adding a capability in the manifest.

    the problem i have though is that i need to be able to support a large amount of file types from the Documents Library,If i add the capability i will have a bad time maintaining the allowed file types under the document library capability.

    Is it possible to just read files without having to add the capability?

    Thursday, October 24, 2013 1:38 AM

Answers

  • Your app can directly read files from its install and app data directories. The app doesn't have permission to read any other location directly. It requires going through a StorageItem so the broker can read the file for you.

    --Rob

    • Marked as answer by c.j.mcnaught Friday, October 25, 2013 12:15 AM
    Thursday, October 24, 2013 3:19 AM
    Moderator

All replies

  • Your app can directly read files from its install and app data directories. The app doesn't have permission to read any other location directly. It requires going through a StorageItem so the broker can read the file for you.

    --Rob

    • Marked as answer by c.j.mcnaught Friday, October 25, 2013 12:15 AM
    Thursday, October 24, 2013 3:19 AM
    Moderator
  • Yes, Rob Caplan is right. You are use your application's local folder & it's data directly without specifying any capability in package.manifiest file. If yuo aretrying to get file from document library, picture libraray, video library, music library, or removable storage than you need to specify capability in your application.

    Thursday, October 24, 2013 11:04 AM
  • Yeh i can see the point of that.

    I am using the file picker to chose the files, so i either have to go with a static list of allowed extensions or

    copy the files into the app local folder at that point and then retrieve them from there later on.

    Friday, October 25, 2013 12:15 AM