This is the "The page cannot be displayed" error when the file is too large. My problem though seems to be more of a timeout issue.
I have set the maxRequestLength="4096" in the web.config, as well as executionTimeout="900". But when I try to upload a file above 900k I still get the above error. Smaller files work fine.
This is on a 640K dsl connection.
I had someone else try to upload a file who had a faster connection (T1) and they were able to upload up to 1.5MB without error.
Im using standard code to upload (see below).
What is going on? Its so simple yet I cannot get it to work.
Thanks,
ADAM
-----------------------------------------------------------------------
<html>
<script language="VB" runat="server">
Sub File_Upload (Sender as Object, e as EventArgs)
Dim strFileName as string
strFileName = MyFile.PostedFile.FileName
Dim myFileName as string = System.IO.Path.GetFileName(strFileName)
Try
MyFile.PostedFile.SaveAs(server.mappath("\jj\pics\") + myFileName)
FileName.InnerHtml = MyFile.PostedFile.FileName
FileContent.InnerHtml = MyFile.PostedFile.ContentType
FileSize.InnerHtml = MyFile.PostedFile.ContentLength
ThankYouMessage.Visible = true
catch Exp as exception
ERRORMSG.InnerHtml=Exp.Message
ErrorMessage.Visible = true
End Try
End Sub
</Script>
<body>
<form method="Post" enctype="Multipart/Form-Data" runat="Server">
Choose a file to upload:<br>
<input id="MyFile" type="File" runat="Server" size="25">
<p></p>
<input type="Submit" value="Upload" onserverclick="File_Upload" runat="Server">
<P>
<aspanel id="ThankYouMessage" runat="server" Visible="False">
Success.<p>
File Name: <span id="FileName" runat="Server"/><br>
File Content: <span id="FileContent" runat="Server"/><br>
File Size: <span id="FileSize" runat="Server"/>bytes<br>
</aspanel>
<aspanel id="ErrorMessage" runat="server" Visible="False">
Your File was not sucessfull.<br>
<span id="ERRORMSG" runat="Server"/>
</aspanel>
</form>
</body>
</html>
I have set the maxRequestLength="4096" in the web.config, as well as executionTimeout="900". But when I try to upload a file above 900k I still get the above error. Smaller files work fine.
This is on a 640K dsl connection.
I had someone else try to upload a file who had a faster connection (T1) and they were able to upload up to 1.5MB without error.
Im using standard code to upload (see below).
What is going on? Its so simple yet I cannot get it to work.
Thanks,
ADAM
-----------------------------------------------------------------------
<html>
<script language="VB" runat="server">
Sub File_Upload (Sender as Object, e as EventArgs)
Dim strFileName as string
strFileName = MyFile.PostedFile.FileName
Dim myFileName as string = System.IO.Path.GetFileName(strFileName)
Try
MyFile.PostedFile.SaveAs(server.mappath("\jj\pics\") + myFileName)
FileName.InnerHtml = MyFile.PostedFile.FileName
FileContent.InnerHtml = MyFile.PostedFile.ContentType
FileSize.InnerHtml = MyFile.PostedFile.ContentLength
ThankYouMessage.Visible = true
catch Exp as exception
ERRORMSG.InnerHtml=Exp.Message
ErrorMessage.Visible = true
End Try
End Sub
</Script>
<body>
<form method="Post" enctype="Multipart/Form-Data" runat="Server">
Choose a file to upload:<br>
<input id="MyFile" type="File" runat="Server" size="25">
<p></p>
<input type="Submit" value="Upload" onserverclick="File_Upload" runat="Server">
<P>
<aspanel id="ThankYouMessage" runat="server" Visible="False">
Success.<p>
File Name: <span id="FileName" runat="Server"/><br>
File Content: <span id="FileContent" runat="Server"/><br>
File Size: <span id="FileSize" runat="Server"/>bytes<br>
</aspanel>
<aspanel id="ErrorMessage" runat="server" Visible="False">
Your File was not sucessfull.<br>
<span id="ERRORMSG" runat="Server"/>
</aspanel>
</form>
</body>
</html>