I searched quite a lot for an answer on the web and found nothing.
Is there a way to get the download path of a browser via Javascript?
I d
That is not possible.
Pure browser-JavaScript is not be able to get information about the user's filesystem. The default download path might also contain sensible information, which is risky:
Imagine that one stores his downloads at C:\CompanyName\RealName\PhoneNumber\Adress\
.
Browsers are deliberately isolated from the local filesystem in order to prevent scripting attacks. You cannot get this information.
https://www.npmjs.com/package/downloads-folder
Usage
const downloadsFolder = require('downloads-folder');
console.log(downloadsFolder());
Installation
$ npm install downloads-folder
Maybe wrong answers. You can do it with some IE versions. It is valid in case you use it for intranet web development as development of products/workflow that requires files. It does not work with other browsers (Schrome, Firefox, Safari, AFAIK).
<input
type="hidden"
id="steel_that_path"
name="steel_that_path" />
<input type="file"
id="this one you use to upload file"
name="this one you use to upload file"
accept="application/octet-stream"
onBlur="document.getElementById('steal_that_path').value=this.value;"/>