No I am not adding test to the filename i just want to upload it under test directory under c:\
the actual code is like this:
Code:
ProtectedSub Button1_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles btnUpload.Click
If FileUpload1.HasFile Then
Try
If System.IO.File.Exists("C:\test\" & FileUpload1.FileName) Then
FileUploadReport.Text = "file exsists try another"
Else
FileUpload1.SaveAs("C:\test\" & FileUpload1.FileName)
EndIf
Catch ex As Exception
FileUploadReport.Text = "Faild Because:<br/>" & ex.Message
EndTry
FileUploadReport.Text = "File uploaded : <br/>" & FileUpload1.PostedFile.FileName
Else
FileUploadReport.Text = "Please select a file before clicking" & " the 'Upload' button"
EndIf
But i do upload the file to a sql database, does that make any diference?
cos every time i click the upload button the database is updated and multiple file names exsist in the table, i need an exeption for that too?