first create A folder in your root directory named AttachedFiles and then try this code
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Attachment()
End Sub
Private Function Attachment() As String
If FileUpload1.HasFile Then
Dim strpath As String = Server.MapPath("~\AttachedFiles").ToString
Dim strAthpath As String
strAthpath = Path.Combine(strpath, FileUpload1.FileName)
FileUpload1.SaveAs(strAthpath)
Label1.Text = "File Upload Successfully"
Return True
Else
Label1.Text = ""
Return Nothing
End If
End Function
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
Offline 81 posts
since Jan 2009