Home > Article > Web Front-end > a tag hyperlink download_html/css_WEB-ITnose
Very urgent. ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
The href="a.exe" and a.zip of the a tag can be downloaded. But the a.pak file cannot be downloaded. How to solve it? Or is there any way to directly download a folder. Includes everything inside! ! ! For example, there are four files in folder a: b.exe, c.zip, d.dll, and e.pak. Click to download. Download a folder! ! ! !
Just package your pak file and then link it!
It should work, try another browser. If not, package it into zip.
The a tag passes the parameters to the new page, and the new page reads the file stream in binary mode. Output the header of the web page, specify the file type, and then output the file
I haven’t tested it yet, so I don’t know if it works...
The a.pak file cannot be downloaded
because the mime type is not registered
You can
Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); Response.AddHeader("Content-Length", fileInfo.Length); Response.AddHeader("Content-Transfer-Encoding", "binary"); Response.ContentType = "application/octet-stream"; Response.WriteFile(fileInfo.FullName); Response.Flush(); Response.End();