h5 download static files

1. The file needs to be placed in the static folder under src
2. If the downloaded content is not recognized by the browser (for example: .exe, .zip, .doc, etc.), the browser will download it directly, but if What is downloaded is the content that the browser can recognize (for example: .png, .jpg, etc.), and the browser will not download it, but open it for preview. Official accounts, mini programs, and WeChat links can only be opened for preview.
If you must download, then use a mobile browser to open the link before downloading.
insert image description here

使用相对路径找到文件
<a href="../../static/用户协议.docx" download="用户协议.docx" >下载协议</a>

Guess you like

Origin blog.csdn.net/i_am_a_div/article/details/128191004