Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイル/添付ファイルのリクエストを処理する ashx ページがあります
コードの最後の行は
System.Web.HttpContext.Current.Response.WriteFile(filename)
GetFile.ashx というファイルをダウンロードすることになります (ページ名のように聞こえますが、.ashx の名前を .zip に変更すると、実際には正しいファイルになります...
これが起こっている理由とそれを止める方法はありますか?
ファイル名とコンテンツタイプを設定するヘッダー値を追加するために必要な問題が解決されました!