Note that there are some explanatory texts on larger screens.

plurals
  1. POunable to upload the pdf document in .net 2.0 and getting exception error
    text
    copied!<p>I have developed a application where i am uploading the PDF files and binding it to Gridview. I can upload less size files like up to 3.5MB after that i can not upload PDF file as i get error message like "Server Error in '/STAT' Application. Runtime Error" or "Page can not be displayed (while testing in local system)"</p> <p>Technologies used : vs 2005 .net 2.0 and it is web application.</p> <p>I have pasted the code below which i wrote : </p> <pre><code>Protected Sub btnUploadSTPI_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUploadSTPI.Click Try If txtStpiRegNo.Text &lt;&gt; "" Then If txtfilepathSTPI.Value &lt;&gt; "" Then Dim objDS As DataSet Dim UploadFile, UploadPath, strFile, sUploadPath, sUploadfilename As String Dim arr As Array UploadFile = txtfilepathSTPI.Value UploadPath = UploadFile.LastIndexOf("\") + 1 strFile = UploadFile.Substring(UploadPath) sUploadPath = System.Configuration.ConfigurationSettings.AppSettings("UploadTempFile").ToString() arr = strFile.Split(".") strFile = CType(arr(0).ToString() + "_" + txtStpiRegNo.Text + "_" + System.DateTime.Now.Second.ToString() + "." + arr(1).ToString, String) sUploadfilename = sUploadPath + strFile txtfilepathSTPI.PostedFile.SaveAs(sUploadfilename) objDS = Session("TempDS") If objDS.Tables.Count &gt; 1 Then Dim objRow As DataRow objRow = objDS.Tables(1).NewRow() objRow.Item("UploadFileName") = arr(0).ToString() objRow.Item("UploadFilePath") = strFile objRow.Item("CompanyID") = ddlCompany.SelectedValue objRow.Item("CompanyDocuments") = "STPI REG NO - " + txtStpiRegNo.Text objDS.Tables(1).Rows.InsertAt(objRow, objDS.Tables(1).Rows.Count + 1) dgCompanyFiles.DataSource = objDS.Tables(1) dgCompanyFiles.DataBind() Session("TempDS") = objDS End If Else lblError.Text = "Please select a file to upload." End If Else lblError.Text = "Please enter STPI REG No." End If Catch ex As Exception End Try End Sub </code></pre> <p>Even I tried tracking the application and it is not going to the particular button event after browsing the file and clicking on the Upload button for larger file size more then 3.5MB..</p> <p>Error Message :</p> <pre><code>Server Error in '/STAT' Application. </code></pre> <p>Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. </p> <p>Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload