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
Member
185 Points
401 Posts
File upload in vb.net (Size of File)
Apr 01, 2019 01:57 AM|shsu|LINK
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()
Participant
1061 Points
667 Posts
Re: File upload in vb.net (Size of File)
Apr 01, 2019 08:11 PM|jzero|LINK
Set maxRequestLength (in Kb) on web.config, you set it in system.web section.
Also if necessary set executionTimeout (in seconds)
https://weblog.west-wind.com/posts/2016/apr/06/configuring-aspnet-and-iis-request-length-for-post-data