Skip to content

File size too large handling #705

@iafb

Description

@iafb

Requests over the size limit (default 30,000,000 bytes) are causing errors by returning null view models. Previously these requests would have caused a BadHttpRequestException however with an update to .Net those exceptions are being caught and a Model State error is returned with no view data. This is resulting in null reference exceptions to occur when trying to access the model. Instead the request methods should be returning a friendly error message informing users of the file size restriction. Additionally a JavaScript check on file size should be done when files are selected to preemptively catch errors before the forms submitted.

dotnet/aspnetcore#36214 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions