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

Mysql keeps the existing content and adds content later

This command modifies the data table ff_vod and a...

Recommended 20 best free English handwriting fonts

Jellyka BeesAntique Handwriting [ank]* Jellyka Cut...

A complete guide to Linux environment variable configuration

Linux environment variable configuration When cus...

Talk about nextTick in Vue

When the data changes, the DOM view is not update...

MySql login password forgotten and password forgotten solution

Method 1: MySQL provides a command line parameter...

Notes on using $refs in Vue instances

During the development process, we often use the ...

Use of MySQL triggers

Triggers can cause other SQL code to run before o...

Introduction to the use and difference between in and exists in MySQL

First put a piece of code for(int i=0;i<1000;i...

Several ways to implement "text overflow truncation and omission" with pure CSS

In our daily development work, text overflow, tru...

How to set the style of ordered and unordered list items in CSS

In an unordered list ul>li, the symbol of an u...

javascript input image upload and preview, FileReader preview image

FileReader is an important API for front-end file...

Tutorial on installing Odoo14 from source code on Ubuntu 18.04

Table of contents Background of this series Overv...

Analysis of the reasons why Vue3 uses Proxy to implement data monitoring

Vue data two-way binding principle, but this meth...