I create a file that I want to be automatically saved to the Downloads folder of a user. So I used:
StorageFile file = await DownloadsFolder.CreateFileAsync("filename.txt");
But if I create that file again, I get an error stating that file already exists. So I used:
StorageFile file = await DownloadsFolder.CreateFileAsync("filename.txt", CreationCollisionOption.ReplaceExisting);
However that also crashes with the error saying that the parameter does not fall within the expected range. But if I use:
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("filename.txt", CreationCollisionOption.ReplaceExisting);
Then it does create the file even if it exists, but I need to create/save the file in the Downloads folder for easier access for the user. I thought of this (attempted) solution because of the issue described here prevented me from adding an attachment to certain e-mail clients.