0

I am scripting an application in php (installed on the client side). There will be a front end accessible from the browser (standard html + javascript, ...) and some background process (php). The application should be able to download files. The plan is to let the user of the front end decide of the target location for the download (folder and filename) with standard browser dialog box (with offering a dummy content) and then to perform the download of the real content with the background processes.

Is there a way to know, with javascript, the target location chosen by the user for a download ? and if yes, how ?

EDIT

To make the question less intrusive : is there a way to let the user choose a target location on its filesystem with a standard dialog box and let the browser know this location ?

Tuckbros
  • 417
  • 3
  • 13
  • You may find useful information for Chrome [here](https://developer.chrome.com/extensions/downloads#method-showDefaultFolder). Look at `onCreated` or `onDeterminingFilename` events. – user1987 May 06 '20 at 21:52
  • 1
    It's not possible and has been already answered here: https://stackoverflow.com/questions/9840923/get-browser-download-path-with-javascript – R0l May 06 '20 at 22:07
  • This answer is almost 8years old. As it seems the information is available to the browser thanks to a webextension using the "download API" (filename property of downloadItem) https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/DownloadItem. There could be a way to do this by requesting a permission just like for camera or microphone. – Tuckbros May 07 '20 at 05:25

0 Answers0