简体   繁体   中英

Uploading big files with .net core 2.1 and Azure

Can you please help, have the next problem:

Can't upload a big file(~200 MB) to the website. Using .net core 2.1 project and Azure blob. So find that I should set up

<system.web>
  <httpRuntime maxRequestLength="1048576" executionTimeout="100000"/>
</system.web>

and

<requestLimits maxAllowedContentLength="1073741824" />

in web.config, but couldn't set it up, so find that i could do it in applicationhost.config

After that in works in local machine, but when deploying the project to Azure it failed and show error: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

Can you please advise what can be problem? Should i setup anything in Azure for upload big files? Or how correct setup web.config(i can't find it in my project)?

Thanks!

Or how correct setup web.config(i can't find it in my project)?

When you deploy the .net core project to Azure, you could go to https://xxxxx.scm.azurewebsites.net and click Debug console> CMD > site > wwwroot > web.config . The web.config will be there. Then you could increase request limits to 200MB as below:

<system.webServer>
    <security>
        <requestFiltering>
            <!-- 100 MB in bytes -->
            <requestLimits maxAllowedContentLength="209715200" />
        </requestFiltering>
    </security>
</system.webServer>

Here is a similar issue you could refer to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM