hi ,
There is file server and Webserver.On file server there are several files.Now when I try to
download a Zip file from file server,Zip file is truncated mid-download (usually around 12mb) and therefore unreadable but when I try to download any other file which is not Zip file and which is of same size or even bigger size, then it downloads that file ,I mean to say it is unable to download only Zip file of more than 12 mb.
What could be the possible reason for this.application has been developed using C# ,ASP.net..
code which is downloading is -
private void DownloadFile(string MyFilePath) FileStream stream = new FileStream( for (; ; )
{
const int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
MyFilePath,
FileMode.Open,
FileAccess.Read,
FileShare.Read);
try
{
string contentDisposition = string.Format(
"attachment; filename=\"{0}\"",
Path.GetFileName(MyFilePath));
Response.AddHeader(
"Content-Disposition",
contentDisposition);
{
int bytesRead = stream.Read(buffer, 0, bufferSize);
if (0 == bytesRead)
{
// all done
break;
}
Response.OutputStream.Write(buffer, 0, bytesRead);
}
}
finally
{
stream.Close();
}
}
View Full Details...............................
No comments:
Post a Comment