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

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

      • <bdo id='ekEKL'></bdo><ul id='ekEKL'></ul>

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

      1. <legend id='ekEKL'><style id='ekEKL'><dir id='ekEKL'><q id='ekEKL'></q></dir></style></legend>

        將大文件上傳到 ASP.NET MVC

        Streaming large file uploads to ASP.NET MVC(將大文件上傳到 ASP.NET MVC)
            <bdo id='bvorQ'></bdo><ul id='bvorQ'></ul>

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

              <tbody id='bvorQ'></tbody>
          • <tfoot id='bvorQ'></tfoot>

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

          • <legend id='bvorQ'><style id='bvorQ'><dir id='bvorQ'><q id='bvorQ'></q></dir></style></legend>

                • 本文介紹了將大文件上傳到 ASP.NET MVC的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  對于我正在開發的應用程序,我需要允許用戶通過我們的網站上傳非常大的文件(即可能有很多千兆字節).不幸的是,ASP.NET MVC 似乎在開始為它提供服務之前將整個請求加載到 RAM 中——對于這樣的應用程序來說并不完全理想.值得注意的是,試圖通過如下代碼來規避這個問題:

                  For an application I'm working on, I need to allow the user to upload very large files--i.e., potentially many gigabytes--via our website. Unfortunately, ASP.NET MVC appears to load the entire request into RAM before beginning to service it--not exactly ideal for such an application. Notably, trying to circumvent the issue via code such as the following:

                  if (request.Method == "POST")
                  {
                      request.ContentLength = clientRequest.InputStream.Length;
                      var rgbBody = new byte[32768];
                  
                      using (var requestStream = request.GetRequestStream())
                      {
                          int cbRead;
                          while ((cbRead = clientRequest.InputStream.Read(rgbBody, 0, rgbBody.Length)) > 0)
                          {
                              fileStream.Write(rgbBody, 0, cbRead);
                          }
                      }
                  }
                  

                  未能規避將請求緩沖到 RAM 的心態.有沒有一種簡單的方法可以解決此問題?

                  fails to circumvent the buffer-the-request-into-RAM mentality. Is there an easy way to work around this behavior?

                  推薦答案

                  原來我的初始代碼基本正確;唯一需要改變的就是改變

                  It turns out that my initial code was basically correct; the only change required was to change

                  request.ContentLength = clientRequest.InputStream.Length;
                  

                  request.ContentLength = clientRequest.ContentLength;
                  

                  前者在整個請求流中確定內容長度;后者僅檢查 Content-Length 標頭,它只要求標頭已完整發送.這允許 IIS 幾乎立即開始流式傳輸請求,從而完全消除了最初的問題.

                  The former streams in the entire request to determine the content length; the latter merely checks the Content-Length header, which only requires that the headers have been sent in full. This allows IIS to begin streaming the request almost immediately, which completely eliminates the original problem.

                  這篇關于將大文件上傳到 ASP.NET MVC的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?(多個提交按鈕點擊問題?)
                • <small id='JkCjo'></small><noframes id='JkCjo'>

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

                            主站蜘蛛池模板: 91久久夜色精品国产网站 | 亚洲综合首页 | 中国一级大黄大片 | 欧美成人h版在线观看 | 91影片| 国产91视频一区二区 | 成人国产精品久久久 | 免费黄色大片 | 色婷婷综合久久久中文字幕 | 亚洲精选一区二区 | 不卡视频一区 | 网站国产| 国产一区久久精品 | 日韩精品视频在线免费观看 | 欧美日韩国产在线观看 | 国产高清在线精品一区二区三区 | 国产福利资源在线 | 国产一区二区三区在线 | 亚洲区一区二 | 亚洲一区二区三区观看 | 亚洲欧美日韩在线不卡 | 亚洲天堂久久 | 第四色影音先锋 | 欧美九九 | 亚洲一二三视频 | 天天操操| 久热精品在线播放 | 日韩免费高清视频 | 国产精品欧美一区二区三区不卡 | 狠狠躁18三区二区一区 | 国产精品久久 | 日韩精品中文字幕在线 | 亚洲高清成人在线 | 精品1区2区3区| 日日骚网 | 成人在线视频免费看 | 中文字幕国产视频 | 成人免费观看视频 | 国产黄色免费网站 | 午夜爽爽爽男女免费观看影院 | 亚洲精品www久久久久久广东 |