question

Madhu-8808 avatar image
Madhu-8808 asked ·

UWP create a file to used by another non UWP app

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://docs.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

windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
RoyLi-MSFT answered ·

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.


Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.