Get browser download path with javascript

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 don't want to set the path myself i just wanna know where my file goes after been downloaded by the user.

Answers:

Answer

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\.

Answer

Browsers are deliberately isolated from the local filesystem in order to prevent scripting attacks. You cannot get this information.

Answer

https://www.npmjs.com/package/downloads-folder

Usage

const downloadsFolder = require('downloads-folder');

console.log(downloadsFolder());

Installation

$ npm install downloads-folder
Answer

wrong answers. you can do it no problem with IE. and it is very valid use case if you do intranet web development for things like production of products/workflow that requires files.... ...but does not work with chrome.

<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('steel_that_path').value=this.value;"/> 

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.