Created
July 13, 2016 15:15
-
-
Save jens1101/3ab419cf45753411e6654bd71b8ed4e0 to your computer and use it in GitHub Desktop.
ASP.NET MVC return custom response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(fileToImport.ContentLength > 5 * 1024 * 1024) | |
{ | |
Response.StatusCode = 500; | |
Response.Write("File is too large to import! The max file size is 5MB."); | |
Response.StatusDescription = "Internal server error"; | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment