fail to upload a larger file...
-
I have a page to upload file as attachment for user's input. If file size is less than 4MB, it works fine. But once the file size is bigger than 4MB, the page will either hang or display "The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings..." The .aspx file is as the following:
The code behind is as shown below: Private Sub Submit1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.ServerClick If Not MyFile.PostedFile Is Nothing And MyFile.PostedFile.ContentLength > 0 Then ' Get the fully qualified path at client Dim strFileName As String = MyFile.PostedFile.FileName ' Recover only the attached file name Dim c As String = System.IO.Path.GetFileName(strFileName) Dim SaveLocation As String SaveLocation = System.Web.HttpContext.Current.Request.PhysicalApplicationPath() & UploadFolder + c Try MyFile.PostedFile.SaveAs(SaveLocation) Span1.InnerHtml = "Your File Uploaded Sucessfully at server as : " & SaveLocation Catch Excp As SystemException Span1.InnerHtml = "An Error occured:" & Excp.Message End Try End If End Sub I tried to trace the code in Submit1_ServerClick(), but this function does't execute at all. I am use .NET 1.1 and debug on my local machine. I have no clue why the larger file doesn't work... Does anyone have any ideas about it? Any advice would be very appreciated! Thanks in advance!
-
I have a page to upload file as attachment for user's input. If file size is less than 4MB, it works fine. But once the file size is bigger than 4MB, the page will either hang or display "The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings..." The .aspx file is as the following:
The code behind is as shown below: Private Sub Submit1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.ServerClick If Not MyFile.PostedFile Is Nothing And MyFile.PostedFile.ContentLength > 0 Then ' Get the fully qualified path at client Dim strFileName As String = MyFile.PostedFile.FileName ' Recover only the attached file name Dim c As String = System.IO.Path.GetFileName(strFileName) Dim SaveLocation As String SaveLocation = System.Web.HttpContext.Current.Request.PhysicalApplicationPath() & UploadFolder + c Try MyFile.PostedFile.SaveAs(SaveLocation) Span1.InnerHtml = "Your File Uploaded Sucessfully at server as : " & SaveLocation Catch Excp As SystemException Span1.InnerHtml = "An Error occured:" & Excp.Message End Try End If End Sub I tried to trace the code in Submit1_ServerClick(), but this function does't execute at all. I am use .NET 1.1 and debug on my local machine. I have no clue why the larger file doesn't work... Does anyone have any ideas about it? Any advice would be very appreciated! Thanks in advance!
submit1_serverclick is in the process of being executed, but first the file has to be uploaded, the problem is the file size limit (default is 4MB) To increase the max length, add the following to your web.config in the system.web element: <httpRuntime maxRequestLength = "8192" /> daniero
-
submit1_serverclick is in the process of being executed, but first the file has to be uploaded, the problem is the file size limit (default is 4MB) To increase the max length, add the following to your web.config in the system.web element: <httpRuntime maxRequestLength = "8192" /> daniero
-
I have a page to upload file as attachment for user's input. If file size is less than 4MB, it works fine. But once the file size is bigger than 4MB, the page will either hang or display "The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings..." The .aspx file is as the following:
The code behind is as shown below: Private Sub Submit1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.ServerClick If Not MyFile.PostedFile Is Nothing And MyFile.PostedFile.ContentLength > 0 Then ' Get the fully qualified path at client Dim strFileName As String = MyFile.PostedFile.FileName ' Recover only the attached file name Dim c As String = System.IO.Path.GetFileName(strFileName) Dim SaveLocation As String SaveLocation = System.Web.HttpContext.Current.Request.PhysicalApplicationPath() & UploadFolder + c Try MyFile.PostedFile.SaveAs(SaveLocation) Span1.InnerHtml = "Your File Uploaded Sucessfully at server as : " & SaveLocation Catch Excp As SystemException Span1.InnerHtml = "An Error occured:" & Excp.Message End Try End If End Sub I tried to trace the code in Submit1_ServerClick(), but this function does't execute at all. I am use .NET 1.1 and debug on my local machine. I have no clue why the larger file doesn't work... Does anyone have any ideas about it? Any advice would be very appreciated! Thanks in advance!