Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP - Get path to user download folder

I have been looking for a little while now and am not finding much help via MSDN resources and others.

My predicament is simple: my app needs a base directory to the Downloads folder. I am aware of the DownloadsFolder class however that is not suiting my needs currently.

How do I get the current user's Download folder path in a Windows Universal App?

like image 353
Steven Floyd Avatar asked Dec 03 '22 14:12

Steven Floyd


1 Answers

Use Windows.Storage.UserDataPaths to get the path of user's download folder.

string downloadsPath = UserDataPaths.GetDefault().Downloads;
  • This method is introduced in build 16232, so clients with RS3(1709) or later will be able to run it.
  • You shouldn't obtain downloads folder path using LocalFolder, which might result in wrong folder when the user changed the default location for it.
like image 107
trueCresc Avatar answered Dec 27 '22 11:12

trueCresc