UWP create a file to used by another non UWP app

Madhu 96 Reputation points
2020-03-08T04:58:17.127+00:00

Hi,

I have a UWP app which needs to share a file to another app in the same machine (the other app is not UWP). I need to write that file to that other app's custom folder (eg D:/xxx/yyy)
I have gone through this article related to file writing from UWP and from what I understand, to do the above I need to use 'restricted broadFileSystem ' capability. If I use that capability to write the file that location, is there any reason for the Store review to decline the app, if we submit all the necessary information during the submission?
https://learn.microsoft.com/en-us/windows/uwp/get-started/fileio-learning-track#general-access

My other question is if we give the user an options to pick that file/folder location initially (one time) using a file picker option, in that case do we need to declare the 'broadFileSystem ' capability?
That article says ' It is important to note that this capability is not required to access files that the user has already chosen using the FilePicker or FolderPicker.'
Does that mean if user select it one time after that the UWP app can write to it any time and will not need this capability in our app?

Thanks
Madhu

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 33,926 Reputation points Microsoft Vendor
    2020-03-09T06:57:12.093+00:00

    Hello,

    Welcome to Microsoft Q&A!

    For the first question, yes, you could try to use broadFileSystem capability. This capability could allow the app to access any file that the user has access to using Storage API with Path. If you need to submit the app to the store, you will need to get special approval for the restricted capabilities. Here is the detailed information: Restricted capability approval process.

    For the second question, yes, if you are using a FileOpenPicker in your app, then you won't need to use broadFileSystem capability. When the user chose a folder at the beginning, you could try to add the folder into Future-access list. By picking files and folders, your user grants your app permission to access items that might not be accessible otherwise. If you add these items to your future-access list then you'll retain that permission when your app wants to access those items again later.
    For more information about how to use Future-access list, please refer to this document: Future-access list. Most part of the document is talking about MostRecentlyUsedList. But the usage of Future-access list is the same as MostRecentlyUsed List.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.