且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当用户点击链接时,文件应该下载

更新时间:2023-02-25 12:29:11

从锚执行服务器端处理程序

您可以调用服务器端处理程序并在那里编写代码来下载文件。

这将是***的技术。

按照答案 - 在html上下载音频文件chor链接单击独立的浏览器操作 [ ^ ]。 />
一篇不错的文章 - 使用JavaScript下载文件 [ ^ ]。



客户端的jQuery库
jquery.fileDownload.js Library [ ^ ]。



谢谢......
Execute Server side handler from anchor
You can call server side handler and write code there to download the file.
That will be the best technique.
Follow the answer - Download audio file on html anchor link click independant of browser action[^].
One nice article - File Download Using JavaScript[^].

jQuery library for client-side
If you want to do it in client-side better to use jquery.fileDownload.js Library[^].

Thanks...