久久久久久久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 請求長度限制的文件?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

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

                  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.

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

                  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))
                          {
                  
                          }
                      }
                  

                  執(zhí)行路徑按照我的意愿進入這個 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?

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

                  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 的性質(zhì),在讀取所有請求數(shù)據(jù)之前,您實際上無法返回任何內(nèi)容.當(dāng)您收到超大請求時,您有兩種選擇:

                  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:

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

                  還有第三種選擇——使用一個高級組件,它提供了很好的錯誤消息和安全性.您可以只使用 Flash 組件,而且其中有很多組件,但是當(dāng)然,如??果用戶沒有 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.

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

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

                  相關(guān)文檔推薦

                  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(從函數(shù)調(diào)用按鈕 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>

                            主站蜘蛛池模板: 久久久久久亚洲国产精品 | 在线观看中文字幕dvd播放 | 国产在线观看一区 | 羞羞视频在线观看 | 国产精品自拍av | 夜久久 | 在线看黄免费 | 免费一区 | 成人免费视频观看 | 日韩一 | 青青久草| 日韩欧美国产一区二区 | 日韩在线视频免费观看 | 日韩1区| 五月天婷婷激情 | 久久久久国产一区二区三区 | 高清欧美性猛交xxxx黑人猛交 | 欧美在线观看黄色 | 极品粉嫩国产48尤物在线播放 | 一区二区蜜桃 | 小早川怜子xxxxaⅴ在线 | 久久久久久高潮国产精品视 | 免费激情网站 | 成人精品视频免费 | 国产精品中文字幕在线 | 性一爱一乱一交一视频 | 亚洲欧美一区二区三区情侣bbw | 国产探花| 视频在线一区 | av资源网站 | 精品一二三区 | 国产精品欧美一区二区三区 | 日韩精品在线看 | 亚洲视频免费在线看 | 天天综合久久 | 在线中文字幕视频 | 色网在线看| 久久精品一区二区 | 偷拍自拍在线观看 | 91视频88av| 一级大黄色片 |