2

I currently have a C# desktop application that exports data and saves to a file. In the current application part of the export process presents the user with a Save File dialog so they can select the directory and filename to save.

I'd now like to migrate this application to be web based. I'm having trouble figuring out how to implement the Save File dialog so the user can select the location and enter a custom filename. The intended users could be fairly technology illiterate so I'd like to avoid the case where they don't remember the configured download directory(or how to find it) and have to go looking for the file.

Basically I'm looking for a way to forcefully and temporarily turn on the option "Ask where to save each file before downloading" in Chrome (or the equivalent in other browsers) for the download.

James
  • 419
  • 4
  • 25
  • Possible duplicate of [Prompt file download](https://stackoverflow.com/questions/40662885/prompt-file-download) – Obsidian Age Jan 24 '18 at 23:31
  • @ObsidianAge I've seen that question. It doesn't address how to force select a file location. It only has to do with actually saving the file and not where the file will be saved. – James Jan 24 '18 at 23:34
  • 1
    Have you read this? https://stackoverflow.com/questions/34870711/download-a-file-at-different-location-using-html5 – Tiago B Jan 24 '18 at 23:50
  • Possible duplicate of [Download A File At Different Location Using HTML5](https://stackoverflow.com/questions/34870711/download-a-file-at-different-location-using-html5) – skyline3000 Jan 24 '18 at 23:55
  • @skyline3000, that sample only shows how to save some text to a file. The file itself is still saving to the browser's predefined download folder. I want to prompt the user similar to how a save dialog works so they can also provide the directory to save to bypassing the browser's download folder selection. – James Jan 25 '18 at 01:49
  • 1
    I understand what your requirement is but I linked it for you to the read the answer. You can't achieve this, at least none of the popular modern browsers allow it. And where the file will get saved will never be available to you in JS. – skyline3000 Jan 25 '18 at 02:39
  • @skyline3000, I don't even really care if the JS code knows where the file gets saved. I basically just want to force the browser to enable the "Ask where to save each file before downloading" option. It appears that isn't an option which is really unfortunate. Maybe migrating to a web based solution isn't a good idea. The average age of the users will be over 50 and many are technologically challenged. Having them not knowing where to find the file is a real problem. – James Jan 26 '18 at 00:33

0 Answers0