a tag hyperlink download_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:14:42
Original
1164 people have browsed it

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! ! ! !


Reply to the discussion (solution)

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();
Copy after login

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