An example of how to use href in HTML to pop up a file download dialog box when clicking a link

高洛峰
Release: 2017-03-07 11:05:59
Original
2683 people have browsed it

Use href to implement file download. I didn’t know it before. Today I learned a trick to click the link to pop up the file download dialog box. Friends who are interested can learn more. I learned another trick today. I didn’t know it before, but I have done too few things...

Goal: Click the link to pop up the file download dialog box
Code:

The code is as follows:

<html> 
<head>代码下载</head> 
<title>代码下载</title> 
<body> 
<a href="Web.rar" >download</a> 
</body> 
</html>
Copy after login


If the browser supports the format that can be opened, it will open it directly online by default (such as word or picture). If the format is not supported, it will pop up a download prompt. It is best to make a file in .rar format

For more examples of how to use href in HTML to pop up a file download dialog box when clicking a link, please pay attention to the PHP Chinese website for related articles!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!