Wednesday 6 March 2013

Upload File in VB

VB
Dim spath As String = Server.MapPath("~/foldername/")
Dim sfile As String = FileUpload1.FileName
Dim sfullpath As String = spath & "\" & sfile
Try
  FileUpload1.SaveAs(sfullpath)


Catch ex As Exception
  Label1.Text = "Failed. " & ex.Message
End Try

No comments:

Post a Comment