Use href in html to pop up a file download dialog box when clicking a link

Use href in html to pop up a file download dialog box when clicking a link
I learned a new trick today. I didn’t know it before because I have done too little...

Objective: Click on the link to pop up a file download dialog box Code:

Copy code
The code is as follows:

<html>
<head>Code Download</head>
<title>Code Download</title>
<body>
<a href="Web.rar" >download</a>
</body>
</html>

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

<<:  Detailed explanation of the difference between IE8 compatibility view (IE7 mode) and standalone IE7

>>:  How to automatically back up the mysql database regularly

Recommend

In-depth analysis of Linux NFS mechanism through cases

Continuing from the previous article, we will cre...

VMware kali virtual machine environment configuration method

1|0 Compile the kernel (1) Run the uname -r comma...

Summary of Creating and Using Array Methods in Bash Scripts

Defining an array in Bash There are two ways to c...

How to detect if the current browser is a headless browser with JavaScript

Table of contents What is a headless browser? Why...

Mysql 5.6 "implicit conversion" causes index failure and inaccurate data

background When performing a SQL query, I tried t...

How to use javascript to do simple algorithms

Table of contents 1 Question 2 Methods 3 Experime...

mysql8.0.11 winx64 installation and configuration tutorial

The installation tutorial of mysql 8.0.11 winx64 ...

CSS achieves the effect of two elements blending (sticky effect)

I remember that a few years ago, there was an int...

Detailed explanation of common for loop in JavaScript statements

There are many loop statements in JavaScript, inc...

A problem with MySQL 5.5 deployment

MySQL deployment Currently, the company deploys M...