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

                  問題描述

                  限時送ChatGPT賬號..

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

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

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

                  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;
                  

                  前者在整個請求流中確定內(nèi)容長度;后者僅檢查 Content-Length 標(biāo)頭,它只要求標(biāo)頭已完整發(fā)送.這允許 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.

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

                            主站蜘蛛池模板: 中文字幕亚洲一区二区三区 | 久久久久久国产精品免费免费狐狸 | 午夜资源 | 黄色国产在线视频 | 久久精品视频网站 | 国产在线高清 | 日韩精品久久一区二区三区 | 国产精品久久久久久久久久妞妞 | 国产伦精品一区二区三区高清 | 日韩精品在线网站 | 日韩av一区二区在线观看 | 国产激情一区二区三区 | 欧美日本一区二区 | 丝袜 亚洲 欧美 日韩 综合 | 欧美福利专区 | 操射视频| 99久久精品免费看国产高清 | 精品国产一区二区在线 | 国产农村妇女毛片精品久久麻豆 | 国产真实乱全部视频 | 日韩欧美在线免费观看 | 欧美精品一区二区三区在线 | 国产精品夜色一区二区三区 | 四季久久免费一区二区三区四区 | 91精品国产综合久久精品 | 97精品国产一区二区三区 | 亚洲视频一 | 亚洲人成人一区二区在线观看 | 一区二区日韩 | 一区二区三区在线播放 | 国产精品视频久久 | 免费看国产一级特黄aaaa大片 | 欧美激情五月 | 狠狠干美女 | 亚洲 欧美 日韩 精品 | 欧美精品一区二区三区在线 | 亚洲精品乱码久久久久久黑人 | 在线国产视频观看 | 久久精品国产一区二区电影 | 国产99免费 | 天天操网 |