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

Setting maxMessageLength local to a specific controler on MVC 4 #10

Open
drobertson123 opened this issue Oct 28, 2012 · 1 comment
Open

Comments

@drobertson123
Copy link

Hi

Thank you very much for the work you are doing. I am attempting to use this in an MVC 4 based web site and need to do very large uploads, possibly up to 1GB video files of training sessions. In addtion I would like to have a number of descriptive fields to be used in a database go along with the upload.

Basicly the use case is as follows;

A small form where the admin selects a file (possibly as large as 1GB), enters a title value (not filename), a description, a few file type classifiers (archive, video, etc...). Upon submission all the data is sent. When the server succesfully finalizes the storage of the upload a database entry is added to the DB with the associated info. In the case of upload failure no DB entry is made and the admin is notified.

I would like to keep the concept in MVC and not use a HTTPHandler if possible(personal bias). I could easily create the File upload functions on a dedicated controler with its own associated security since this is only for the site admin to use. The issue seems to be around the maxMessageLength in MVC. I agree that it is a bad idea to set a huge maxMessageLength value for the entire site, but would it be possible to set an apropriate value on a location for JUST that controler? I have been beating my head against the wall on this issue and was hoping you had some thoughts.

I am doing this all in VS 2012 with .NET 4.5 & MVC 4 and the site is running on IIS 7.5.

Thanks,
Doug

@DmitryEfimenko
Copy link

See this stackoverflow question to find out how you can assign maxRequestLength per controller action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants