久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='hbC6I'></tfoot>
  • <legend id='hbC6I'><style id='hbC6I'><dir id='hbC6I'><q id='hbC6I'></q></dir></style></legend>
      <bdo id='hbC6I'></bdo><ul id='hbC6I'></ul>

        <small id='hbC6I'></small><noframes id='hbC6I'>

      1. <i id='hbC6I'><tr id='hbC6I'><dt id='hbC6I'><q id='hbC6I'><span id='hbC6I'><b id='hbC6I'><form id='hbC6I'><ins id='hbC6I'></ins><ul id='hbC6I'></ul><sub id='hbC6I'></sub></form><legend id='hbC6I'></legend><bdo id='hbC6I'><pre id='hbC6I'><center id='hbC6I'></center></pre></bdo></b><th id='hbC6I'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hbC6I'><tfoot id='hbC6I'></tfoot><dl id='hbC6I'><fieldset id='hbC6I'></fieldset></dl></div>

        上傳超過 Asp.net 請求長度限制的文件?

        Uploading files past Asp.net request length limit?(上傳超過 Asp.net 請求長度限制的文件?)

            <small id='1ZcmI'></small><noframes id='1ZcmI'>

              <legend id='1ZcmI'><style id='1ZcmI'><dir id='1ZcmI'><q id='1ZcmI'></q></dir></style></legend>
            • <tfoot id='1ZcmI'></tfoot>
                <tbody id='1ZcmI'></tbody>
              • <bdo id='1ZcmI'></bdo><ul id='1ZcmI'></ul>
                <i id='1ZcmI'><tr id='1ZcmI'><dt id='1ZcmI'><q id='1ZcmI'><span id='1ZcmI'><b id='1ZcmI'><form id='1ZcmI'><ins id='1ZcmI'></ins><ul id='1ZcmI'></ul><sub id='1ZcmI'></sub></form><legend id='1ZcmI'></legend><bdo id='1ZcmI'><pre id='1ZcmI'><center id='1ZcmI'></center></pre></bdo></b><th id='1ZcmI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1ZcmI'><tfoot id='1ZcmI'></tfoot><dl id='1ZcmI'><fieldset id='1ZcmI'></fieldset></dl></div>

                • 本文介紹了上傳超過 Asp.net 請求長度限制的文件?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我搜索了 SO,發現 這個問題,但這不是我要問的.我想知道是否可以創建一個可以檢查請求的 ContentLength 的 IHttpModule,如果可以,則重定向或以某種方式拋出該請求并創建一個新請求.

                  I searched SO and found this question, but it's not quite what I'm asking. I'm wondering if a IHttpModule can be created that can inspect the ContentLength of the request, and if so either redirect or somehow throw that request out and create a new one.

                  具體來說,我正在嘗試處理圖像文件上傳,但我想讓請求繼續到上傳頁面并發出某種警告,而不是一個簡單的錯誤頁面.我有這段代碼會受到很大的請求:

                  Specifically, I'm trying to handle image file uploads, but I'd like to have the request continue on to the upload page with some kind of warning, rather than a flat error page. I have this bit of code that gets hit with a large request:

                      private void context_BeginRequest(object sender, EventArgs e)
                      {
                          HttpApplication application = (HttpApplication)sender;
                          HttpContext context = application.Context;
                  
                          if (context.Request.ContentLength > (4 * 1024 * 1024))
                          {
                  
                          }
                      }
                  

                  執行路徑按照我的意愿進入這個 IF 塊.但從這里開始,我真的不知道該去哪里.這是一個不好的方法嗎?

                  The execution path enters this IF block like I want it to. But from here, I'm not really sure where to go. Is this a bad approach?

                  按原樣(沒有此模塊),Fiddler 報告 IIS 正在返回 500 代碼.我想避免這種情況,并讓代碼從請求的頁面返回 200,就像我說的那樣發出警告.

                  As it is (without this module), Fiddler is reporting that IIS is returning a 500 code. I'd like to avoid this and have the code return a 200 from the requested page, just with the warning like I said.

                  推薦答案

                  由于 HTTP 的性質,在讀取所有請求數據之前,您實際上無法返回任何內容.當您收到超大請求時,您有兩種選擇:

                  Because of the nature of HTTP, you can't actually return anything until you read all the request data. When you receive an oversized request, you have two options:

                  • 讀入所有數據,然后返回一個漂亮的錯誤頁面.這聽起來不錯,但意味著用戶必須等待上傳完成才能收到他無法上傳的消息.它還打開了一個可能的 DOS 攻擊漏洞
                  • 立即終止請求.這會給用戶一個糟糕的斷開連接頁面,但保留了安全性.

                  還有第三種選擇——使用一個高級組件,它提供了很好的錯誤消息和安全性.您可以只使用 Flash 組件,而且其中有很多組件,但是當然,如??果用戶沒有 Flash,那您就不走運了.

                  There is a third option -- use an advanced component that provides both nice error messages as well as security. You can use flash only components, and there are many of them out there, but of course, if the user doesn't have flash, you're out of luck.

                  這篇關于上傳超過 Asp.net 請求長度限制的文件?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)
                  ASP.net C# Gridview ButtonField onclick event(ASP.net C# Gridview ButtonField onclick 事件)
                  Adding OnClick event to ASP.NET control(將 OnClick 事件添加到 ASP.NET 控件)
                  Multiple submit Button click problem?(多個提交按鈕點擊問題?)
                  • <bdo id='PJ9lJ'></bdo><ul id='PJ9lJ'></ul>
                  • <legend id='PJ9lJ'><style id='PJ9lJ'><dir id='PJ9lJ'><q id='PJ9lJ'></q></dir></style></legend>
                      <tfoot id='PJ9lJ'></tfoot>

                        <small id='PJ9lJ'></small><noframes id='PJ9lJ'>

                        <i id='PJ9lJ'><tr id='PJ9lJ'><dt id='PJ9lJ'><q id='PJ9lJ'><span id='PJ9lJ'><b id='PJ9lJ'><form id='PJ9lJ'><ins id='PJ9lJ'></ins><ul id='PJ9lJ'></ul><sub id='PJ9lJ'></sub></form><legend id='PJ9lJ'></legend><bdo id='PJ9lJ'><pre id='PJ9lJ'><center id='PJ9lJ'></center></pre></bdo></b><th id='PJ9lJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PJ9lJ'><tfoot id='PJ9lJ'></tfoot><dl id='PJ9lJ'><fieldset id='PJ9lJ'></fieldset></dl></div>

                          <tbody id='PJ9lJ'></tbody>

                            主站蜘蛛池模板: 亚洲+变态+欧美+另类+精品 | 精品久久久久久亚洲综合网 | 久草视频在线看 | 欧美日韩高清 | 国产精品久久久久久久岛一牛影视 | 欧美日韩高清免费 | 国产精品二区三区在线观看 | 精品欧美一区二区三区久久久 | 中文字幕一区二区三区日韩精品 | 国产乱码精品1区2区3区 | a级片www| 欧美成人猛片aaaaaaa | 日韩欧美中文字幕在线观看 | 国产在线永久免费 | 久久久久久久久久久一区二区 | 亚州精品天堂中文字幕 | 成人小视频在线观看 | 日韩高清国产一区在线 | 99久久精品免费视频 | 龙珠z国语版在线观看 | 中文字幕在线一区 | 在线视频一区二区 | 九九视频在线观看 | 国产99视频精品免费视频7 | 91av精品 | 国产免费一区 | 天堂av免费观看 | 亚洲aⅴ | 精品国产一区二区国模嫣然 | 色婷婷激情综合 | 欧美日韩中 | 午夜成人免费视频 | 奇色影视 | 欧美一级淫片免费视频黄 | 国产伦一区二区三区四区 | 久久精品久久综合 | 99久久久久 | 久草成人 | 国产精品久久久久免费 | 国产中文区二幕区2012 | 欧洲精品一区 |