Get browser loading path using javascript

I searched a lot for an answer on the Internet and found nothing.

Is there a way to get the browser loading path through Javascript?

I don’t want to set the path myself, I just want to know where my file is sent after the user downloads it .

+8
javascript browser path download
source share
3 answers

It's impossible.

A clean JavaScript browser will not be able to retrieve user file system information. The default download path may also contain reasonable information, which is risky:

Suppose it stores your downloads in C:\CompanyName\RealName\PhoneNumber\Adress\ .

+17
source share

Browsers are intentionally isolated from the local file system to prevent script attacks. You cannot get this information.

+8
source share

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

Using

 const downloadsFolder = require('downloads-folder'); console.log(downloadsFolder()); 

Installation

 $ npm install downloads-folder 
0
source share

All Articles