如何在下载文件时禁用pop
问题描述:
我正在编写代码来下载特定路径的文件,但是当我点击下载按钮时它会弹出,我不想那样弹出,即打开,保存,取消弹出。
I am writing code for download the file for a particular path but it gives pop up when I click download button , i do not want to that pop up i.e. open ,save ,cancel pop up.
答
你无法避免它:它是一个浏览器功能(只有一些浏览器),旨在防止你的网站在他不知情的情况下将内容下载给用户。
即使尝试禁用它也可能被视为恶意活动,因为它试图绕过安全措施。当然不是一个非常有效的措施 - 而是一种安全措施。
You can't avoid it: it's a browser feature (and only some browsers) that is designed to prevent your site downloading stuff to the user without his knowledge.
Even trying to disable it would probably be seen as malicious activity since it is trying to bypass a security measure. Not a very effective measure, certainly - but a security measure.