V
Vai2000
Hi All, I am trying to allow clients to download zipped file from my system
using the code below. Apparently the file gets downloaded but when the users
try opening the file with WinZip they get problem saying
Cannot open this file: it doesn't appear to be a valid archive. If you
downloaded this file, try downloading the file again.
When I open the compressed file on the server, its fine.
Any clues?
TIA
using(FileStream fs=new FileStream(compressedFileNm,FileMode.Open))
{
byte [] data=new Byte[fs.Length];
BinaryReader br=new BinaryReader(fs);
br.Read(data,0,data.Length);
br.Close();
Response.ContentType="application/x-zip-compressed";
Response.AppendHeader("Content-Disposition","filename="
+compressedFileNm);
Response.BinaryWrite(data);
}
using the code below. Apparently the file gets downloaded but when the users
try opening the file with WinZip they get problem saying
Cannot open this file: it doesn't appear to be a valid archive. If you
downloaded this file, try downloading the file again.
When I open the compressed file on the server, its fine.
Any clues?
TIA
using(FileStream fs=new FileStream(compressedFileNm,FileMode.Open))
{
byte [] data=new Byte[fs.Length];
BinaryReader br=new BinaryReader(fs);
br.Read(data,0,data.Length);
br.Close();
Response.ContentType="application/x-zip-compressed";
Response.AppendHeader("Content-Disposition","filename="
+compressedFileNm);
Response.BinaryWrite(data);
}