Max upload size for ASP.MVC CORE website

后端 未结 2 1134
栀梦
栀梦 2021-02-08 20:59

How can I set maximum upload size for an ASP.NET CORE application?

In the past I was able to set it in web.config file like this:



        
2条回答
  •  甜味超标
    2021-02-08 21:33

    Two ways to do that:

    1.Using application wise settings - in the > configure services method.

    services.Configure(options =>
    {
        options.MultipartBodyLengthLimit = 52428800;
    });
    

    2.Using RequestFormSizeLimit attribute - for specific actions. - It is not yet available in official package Unofficial

提交回复
热议问题