dinesh kumar
dinesh kumar

Reputation: 3

Can't upload tiff file which is 5MB or more in size

When I upload small sized tiff file(approx. 800KB) in my website folder on local system through fileupload control in asp.net. It uploads the file successfully. But when I upload 5MB or more in size tiff file. It can't upload file and display the following message.

Internet Explorer cannot display the webpage.

Here is my code:


if (FileUpload1.HasFile)
        {
            string filename = FileUpload1.PostedFile.FileName.ToString();
            string fileType=Path.GetExtension(filename);
            if ((fileType == ".tiff") || (fileType == ".tif"))
            {
                FileUpload1.SaveAs(Server.MapPath("~/uploads/bio/" + FileUpload1.FileName.ToString()));
                Response.Write("File Saved");
            }
            else
            {
                Response.Write("Select only tiff file");
            }  
        }


Please give any suggestion.

Thanks in advance
Dinesh Kumar

Upvotes: 0

Views: 2441

Answers (2)

Mika Petteri Korhonen
Mika Petteri Korhonen

Reputation: 26

I think that your broblem is on the IIS server maxi configuration.

IIS 6: http://tutorials.fastdot.com.au/web/Tutorials/Windows-Plesk-Server-Management/IIS-Upload-File-Size/ IIS 7: http:// www.cyprich.com/2008/06/19/fixing-file-upload-size-limit-in-iis-7/

Upvotes: 1

jvdbogae
jvdbogae

Reputation: 1229

You would expect that there is a file size limit on uploads:

http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx

Upvotes: 1

Related Questions