[英]how to open save as dialog box of browser with javascript or other language?
[英]How to open save dialog box instead of file getting opened in browser for my Sharepoint site
我的网站是在SharePoint 2010中开发的。
在我的测试网站中,
<a href="file.pdf" target="_blank">Download File</a>
单击上面的标签时,文件将直接在浏览器中打开(IE / Chrome / FireFox)
但是,在我的Live网站中使用了相同的标签,它要求保存文件(在IE中)或下载文件(在Chrome中)。
有关文件上的链接,请使用标准SharePoint download.aspx页。
<a href="http://yourSite/_layouts/download.aspx?SourceUrl=http://pathToFile" target="_blank">Download File</a>
Download.aspx将读取您作为SourceUrl发送的文件的内容,并在HTTP响应上将其呈现回给您。
希望能有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.