Issues getting a list of files RRS feed

  • Question

  • I want the following functionality:-

    Display a list of pdf files from a folder in a users my documents folder, allow the user to click on a file, and launch adobe or some sort of pdf viewer. 


    Whilst I can achieve this, it appears the only way to make this happen is to register your application as handling pdf files. If you don't the following code will not return any pdf files:-

    StorageFolder picturesFolder = KnownFolders.DocumentsLibrary;
                StorageFolderQueryResult queryResult = picturesFolder.CreateFolderQueryWithOptions(new QueryOptions());
                IReadOnlyList<IStorageFolder> folderList = await queryResult.GetFoldersAsync();
                List<FileLocationWithImage> files = new List<FileLocationWithImage>();


    This is pretty strange behaviour for users as my app doesn't do anything with pdfs, so saying that I handle them is incorrect.


    Friday, December 23, 2011 9:51 AM


  • This is the correct way to access files in the Document folder.  You must declare the file type in your manifest or your code will not work.  This is not true for the other well known folders like images or videos.


    Jeff Sanders (MSFT)
    Thursday, December 29, 2011 1:45 PM