Ben WriteFile kullanarak bu dosyayı geçir sunucuda bir 5Mb pdf bana transmitfile doğru 5Mb dosya boyutu verir gibi bir 15Mb indir, ...Response.TransmitFile dosya boyutu vs C# Response.WriteFile sorunları
mi verir var Bu, writeFile için sunucudaki belleğe bir çeşit sıkıştırılmadan kaynaklanıyor mu? Herkes oluyor aynı şeyi görmüştü eğer sadece
if (File.Exists(filepath))
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.AddHeader("content-disposition","attachment;filename=\""+Path.GetFileName(filepath)+"\"");
HttpContext.Current.Response.AddHeader("content-length", new FileInfo(filepath).Length.ToString());
//HttpContext.Current.Response.WriteFile(filepath);
HttpContext.Current.Response.TransmitFile(filepath);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
}
Ben de aynı hatayı yaşadım. IIS'deki sıkıştırma ayarları bunu etkilemez. – geofftnz