简体   繁体   English

JavaScript下载文件强制提示目的地

[英]Javascript download file force prompt destination

I'm downloading a file via javascript (the file is generated on the server) and I want to force the browser to prompt the user to choose the destination of the file. 我正在通过javascript下载文件(该文件是在服务器上生成的),我想强制浏览器提示用户选择文件的目的地。 Is it possible? 可能吗? For instance, Chrome as an option with a default folder and I want to be able to override that option 例如,Chrome是带有默认文件夹的选项,而我希望能够覆盖该选项

EDIT (explaining the duplicate question) I think it's not a duplicate because I know why the dialog is not opening, just want to ask if the behavior can be overriden 编辑(解释重复的问题)我认为它不是重复的,因为我知道为什么对话框没有打开,只是想问一下是否可以覆盖该行为

You cannot override the download behaviour. 您不能覆盖下载行为。 A number of modern browsers save any download into a default location without prompting the user. 许多现代浏览器将所有下载内容保存到默认位置,而不会提示用户。 That's how they download files, period. 那就是他们下载文件的方式。 You cannot override this. 您不能覆盖它。 It's a user choice in the browser's preferences whether they want to be prompted or not. 无论是否希望提示,都是用户在浏览器首选项中进行的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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