サーバー上に 5Mb の pdf があり、writeFile を使用してこのファイルをダウンロードすると、15Mb のダウンロードが得られますが、transmitfile では正しい 5Mb のファイルサイズが得られます...
これは、サーバー上の writeFile のメモリへのある種の圧縮解除によるものですか? 誰かが同じことが起こっているのを見たのだろうか...
(ps は、iis7 に移行してから気付いただけでしょうか??)
コードは...
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();
}