i am trying to test to see if i get an error if i upload more than 3mb file size but instead i get the IE error (see below)
here is the code i have. - what i want is if the user try to upload more than 3mb file size display an error.
if (fUpload.HasFile)
{
// Get the size in bytes of the file to upload.
int fileSize = fUpload.PostedFile.ContentLength;
// Allow only files less than 3145728 bytes (approximately 3 MB) to be uploaded.
if (fileSize > 3145728) //if (fUpload.PostedFile.ContentLength <= 3072)
{
..............
.............
}
else
{
// Notify the user why their file was not uploaded.
this.lblStatus.Text = "Your file was not uploaded because it exceeds the 3 MB size limit.";
}
}
<system.web>
<httpRuntime maxRequestLength="3145728" />
Internet Explorer cannot display the webpage
This problem can be caused by a variety of issues, including:
•Internet connectivity has been lost.
•The website is temporarily unavailable.
•The Domain Name Server (DNS) is not reachable.
•The Domain Name Server (DNS) does not have a listing for the website's domain.
•There might be a typing error in the address.
•If this is an HTTPS (secure) address, click Tools, click Internet Options, click Advanced, and check to be sure the SSL and TLS protocols are enabled under the security section.