locked
maxRequestLength security problem RRS feed

  • Question

  • User671453965 posted
    <httpRuntime 
    executionTimeout="90" 
    maxRequestLength="4096" 
    useFullyQualifiedRedirectUrl="false" 
    minFreeThreads="8" 
    minLocalRequestFreeThreads="4" 
    appRequestQueueLimit="100" 
    enableVersionHeader="true"
    />

    I have a function to upload pdf to server. I used setting above in web config to limit the file size to 4MB. Can I set a alert to inform user the file size over limit? Now the setting above will show "the web page is not available" and when I click back button and click other buttons, the button function is not working properly, all will show "the web page is not available". How to solve this? Thanks.

    Monday, February 23, 2015 3:04 AM

Answers

  • User-1716253493 posted

    increase maxrequestlengh value, then limit the size from code behind

            if (FileUpload1.FileContent.Length <= 4096)
            {
                //upload process
            }
            else
            {
                //show message
            }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 23, 2015 3:43 AM