0

My case is when I am uploading file with size more than 4mb i want to display a friendly message to the user but when i accross this limit it dose not give me an error instead it takes me to :

  Internet Explorer cannot display the webpage 

what i am doing to check on file size is like that :

   if (FU_EnglishFile.PostedFile.ContentLength > int.Parse(ConfigurationManager.AppSettings["MaxUploadSize"]))
                            {
                                lbl_InvalidFileMsg.Visible = true;
                                return;
                            }
                            else
                            {
                                lbl_InvalidFileMsg.Visible = false;
}

where my file size from the web config is :

 <add key="MaxUploadSize" value="4194304" />

is there is any configuration should i set in the web config or something any help would be a appreciated

2 Answers 2

1

Please use above code for less size like 3MB and then check the results.

Sign up to request clarification or add additional context in comments.

Comments

0

I found an answer to the question :

kindly set this tag in the web config

  <system.web>
    <httpRuntime executionTimeout="240" maxRequestLength="20480" />
 </system.web>

thanks

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.