简体   繁体   中英

Download file without opening download dialog

The Problem:

I need to force the download dialog not to open in a browser when in a downloading process:

I have the server code like any other download servlet .
On the client side I have a link that points to the servlet like any other download link .

Is there a way to download automatically when clicking on the link without opening the dialog?

What I think is that it may be related to the following:

  1. Server code ( Java ) ?
  2. Client code ( JavaScript ) ?
  3. Browser settings ?
  4. Browser type ?

The Purpose behind this:

There is a website that belongs to this company where it is fortified with a high security wall clearing out the chance of downloading any virus.

The clients of this site need to have the download link saving automatically when clicked on.

No, you can't interact with files on HDD from a browser without notifying the user . It's a security policy.

If I understand well, you want the browser to download your file on a default folder without asking you where?

Well, I think that, this depends on your browser, maybe you can customize the configuration in order to set a default download folder, but, I think it is not possible to force it on the server side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM