Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per file size limit in multipart form #58225

Open
1 task done
goremykin opened this issue Oct 3, 2024 · 1 comment
Open
1 task done

Per file size limit in multipart form #58225

goremykin opened this issue Oct 3, 2024 · 1 comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@goremykin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

As title says my suggestion is to add a per file size limit for multipart forms. Use case:
A user can upload an unlimited number of files with a total size not exceeding 1GB, but each file must be up to 100MB.

Describe the solution you'd like

Add an additional prop to FormOptions. So it can be configured globally:

services.Configure<FormOptions>(options =>
{
    options.MultipartBodyLengthLimit = 1024 * 1024 * 1024;
    options.FileLengthLimit = 1024 * 1024;
});

or using RequestFormLimits attr
[RequestFormLimits(MultipartBodyLengthLimit = 1024 * 1024 * 1024, FileLengthLimit = 1024 * 1024)]

Additional context

No response

@goremykin goremykin changed the title Per file size limit in multupart form Per file size limit in multipart form Oct 3, 2024
@akeyscare
Copy link

Sure, very important feature

@gfoidl gfoidl added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

3 participants