强制打开“另存为..."在文本链接处打开弹出窗口单击 HTML 中的 PDF

强制打开“另存为...

问题描述:

我的网站上有一些大尺寸的 PDF 目录,我需要将它们作为下载链接.当我用谷歌搜索时,我发现了下面提到的这样一个事情.它应该在链接点击时打开另存为..."弹出窗口...

I have some big size PDF catalogs at my website, and I need to link these as download. When I googled, I found such a thing noted below. It should open the "Save As..." popup at link click...

 <head>
    <meta name="content-disposition" content="inline; filename=filename.pdf">
    ...

但它不起作用:/当我链接到如下文件时,它只是链接到文件并试图打开文件.

But it doesn't work :/ When I link to a file as below, it just links to file and is trying to open the file.

    <a href="filename.pdf" title="Filie Name">File name</a>

更新(根据以下答案):

据我所知,没有 100% 可靠的跨浏览器解决方案.可能最好的方法是使用下面列出的网络服务之一,并提供下载链接...

As I see there is no 100% reliable cross-browser solution for this. Probably the best way is using one of the web services listed below, and giving a download link...

来自对点击链接后强制浏览器保存文件:

<a href="path/to/file" download>Click here to download</a>