このコードの正しい使用法は何ですか?
httpContext.Response.AddHeader("Content-Disposition", "inline; filename=" + HttpUtility.UrlPathEncode(fileName));
httpContext.Response.ContentType = "image/png";
httpContext.Response.AddHeader("Content-Length", new FileInfo(physicalFileName).Length.ToString());
httpContext.Response.TransmitFile(physicalFileName);
httpContext.Response.Flush();
httpContext.Response.End(); //Use it or not?
.Flush()
使うのは本当にいい.End()
ですか?
これによると、決して使用Response.End()
しないでください(エラーまたはハッキングのシナリオでのみ)
しかし、いくつかの答えでは、それ.End()
が推奨されています...?
この記事のように。
それで、使用するのが適切Response.End
かどうか?