locked
File upload in vb.net (Size of File) RRS feed

  • Question

  • User-1578974752 posted

    I am using vb.net file upload. But when the size is bigger i can not upload. How to make , at least with 5MB. Now error showing is " System.Web.HttpException: Maximum request length exceeded". Even 1 MB I can not upload now Appreciate the Help

    My code is as below:

      Dim conn As New OracleConnection("Data Source=abc;User ID=abc;Password=abc")
            cmd.Connection = conn

            ' drd.Close()
            'Extract Image File Name.
            '  con.Close()
            Dim fileName As String = Path.GetFileName(FileUpload1.PostedFile.FileName)
            FILETXT.Text = fileName

                   'Set the Image File Path.

            Dim filePath As String = "~/Uploads/" & fileName
            fileP.Text = filePath


            'Save the Image File in Folder.

            FileUpload1.PostedFile.SaveAs(Server.MapPath(filePath))


            conn.Open()

            cmd.CommandText = "update  rep_hdr set FILE='" + FILETXT.Text + "',PATH ='" + fileP.Text + "' where INCIDENT_NUMBER='" + inci.Text + "'"

            cmd.ExecuteNonQuery()


            conn.Close()
            incisearch.Text = inci.Text
            kgrid0.DataBind()

    Monday, April 1, 2019 1:57 AM

Answers