im trying to test a simple fileupload control in an ASP.NET page
i put in a fileupload control, a button, and a status message but it wont upload the file
here is my code
and the error I get is
Protected Sub uploadbutton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uploadbutton.Click
If FileUpload1.HasFile Then
Dim filename As String = Path.GetFileName(FileUpload1.FileName)
FileUpload1.SaveAs(HttpContext.Current.Server.MapPath("C:\FileDestination") & filename)
statuslabel.Text = "Upload status: File uploaded!"
Catch ex As Exception
statuslabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message
'C:/FileDestination' is a physical path, but a virtual path was expected.
what did i do wrong ?