如何给出本地路径下载文件 [英] How to give local path to download file
问题描述
我有asp.net应用程序,我想在链接上下载文件点击
我的HTML代码
< a href = Docs / Test.pdf < span class =code-attribute> download > 下载< / a >
这个工作正常,因为Docs文件夹在同一个项目中,但是当我想给当地路径像
< a href = C:\Users\xyz \Downloads\Test.pdf 下载 > 下载< / a >
此行代码未能下载,如何正确下载本地路径?
请帮助我
提前感谢。 ..
我的尝试:
我的HTML代码工作正常
< a href = Docs / Test.pdf download > 下载< / a >
我的HTML代码,不下载文件
< pre lang =HTML> < a href = C:\ Users \ xyz \Downloads\Test.pdf download > 下载< / a >
在给出目录路径之前,请使用file:///。另外,使用/& \正确。
这是我系统中的工作解决方案,
<峰; br />
< a href =file:/// C:\ Users \ 105800 \Downloads\Systems - Casinolink - Slot.pdfdownload>下载< / a>
< br />
如有任何问题,请退回。
I have asp.net application where i want to download file on link click
My HTML Code
<a href="Docs/Test.pdf" download>Download</a>
This is working fine because the Docs folder in same project, but when i want to give local path like
<a href="C:\Users\xyz\Downloads\Test.pdf" download>Download</a>
this line of code failing to download, how to give local path to download properly?
Please help me
thanks in advance...
What I have tried:
My HTML Code which is working fine
<a href="Docs/Test.pdf" download>Download</a>
My HTML Code which is not downloading file
<a href="C:\Users\xyz\Downloads\Test.pdf" download>Download</a>
Please use "file:///" before giving the path of the directory. Also, use "/" & "\" properly.
Here is the working solution in my system,
<br/> <a href="file:///C:\Users\105800\Downloads\Systems - Casinolink - Slot.pdf" download>Download</a> <br/>
Please revert back for any issues.
这篇关于如何给出本地路径下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!