Show ZIP file using IE

J

Just D.

All,

I know that we can easily expose RTF file and IE will open an appropriate
application for this file. Here is the code:

Response.Clear();
Response.Charset = "";
Response.ContentType = "application/msword";
Response.Buffer = true;
Response.Write(SomeRTFReport);

How can we do similar to show ZIP archive loaded on the server side as
byte[]? When I try to do that using this trick:

Response.Clear();
Response.Charset = "";
Response.ContentType = "application/zip";
Response.Buffer = true;
Response.Write(SomeZippedReports);

It doesn't work this way. Did anybody do that and how? I don't want to use
temp files and keep these bin ZIP files on the server side to let user
download it, but I'd like to find a way to write the content of this file
directly into the stream to let IE load it and start the app associated with
ZIP archives.

Just D.
 
H

Hans Kesting

All,
I know that we can easily expose RTF file and IE will open an appropriate
application for this file. Here is the code:

Response.Clear();
Response.Charset = "";
Response.ContentType = "application/msword";
Response.Buffer = true;
Response.Write(SomeRTFReport);

How can we do similar to show ZIP archive loaded on the server side as
byte[]? When I try to do that using this trick:

Response.Clear();
Response.Charset = "";
Response.ContentType = "application/zip";
Response.Buffer = true;
Response.Write(SomeZippedReports);

It doesn't work this way. Did anybody do that and how? I don't want to use
temp files and keep these bin ZIP files on the server side to let user
download it, but I'd like to find a way to write the content of this file
directly into the stream to let IE load it and start the app associated with
ZIP archives.

Just D.

The content type is OK, you might want to use Response.BinaryWrite(..)
and maybe Response.AppendHeader("Content-Disposition",
"attachment;filename=thefile.zip");

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top