Usually when we write the project will encounter upload download what, after uploading the file will be stored in the file path to the database in order to download, if you want not to download directly in the background, you can take the file path to a tag attribute href;
<a href= "/user/test/xxxx.txt" > click to download </a>
This will download the file directly when the user opens the browser and clicks the link.
However, there is a situation, such as txt,png,jpg, and so on, these browsers support directly open files will not perform the download task, but will open the file directly, this time need to add an attribute "download" to the A tag;
<a href= "/user/test/xxxx.txt" download= "filename. txt" > click Download </a>
Here download can also not write any information, will automatically use the default file name.
Here is a description of some IE does not seem to support, only through the background code to engage.
A-tag implementation in HTML Click to download