下载文件而不打开下载对话框 [英] Download file without opening download dialog

查看:83
本文介绍了下载文件而不打开下载对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下载过程中,我需要强制下载对话框不要在浏览器中打开:

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

我拥有服务器 code ,就像其他任何下载的 servlet 一样。

在客户端,我有一个 link 指向 servlet ,就像其他任何下载 link 一样。

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. 服务器代码( Java )吗?

  2. 客户端代码( JavaScript )吗?

  3. 浏览器设置?

  4. 浏览器类型?

  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.

推荐答案

否,您不能在不通知用户的情况下与浏览器中的 HDD 上的文件进行交互。这是一项安全政策。

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

这篇关于下载文件而不打开下载对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆