c# - Zip Mime Type appears unrecognised -
I am trying to return a zip file, as a stream on a browser. It works fine with other types of files (like Excel files), but when I start working with zip files, I do not have to recognize my browser as it's a zip.
Both Firefox and IE are running on my test, with the machine prompt, opening the file to the program to be asked. The Explorer Zip file is set as the default for the union.
IE does not report much back, Firefox still tells me what file type is
application / zip
where As far as I can tell, the correct mime type for the zip file. The only thing I have not set up is that extension, so the file is called 'test' instead of 'test.zip', but as far as I knew that everyone should understand the mime way.
Anyone can be wrong but have any thoughts?
Includes ensuring you file, file extension:
Content-Properties : Attachment; File name = test.zip
as the header.
in C #:
response. Contact type = "app / zip"; Response.AddHeader ("content-length", contentLength.ToString ()); Response.AddHeader ("content-type", "attachment; file name =" + filename); If (Request.UserAgent.Contains ("MSIE")) {Response.AddHeader ("Content-Transfer-Encoding", "Binary"); }
Comments
Post a Comment