Thread: File upload
View Single Post
  #1 (permalink)  
Old January 8th, 2009, 04:08 AM
bex bex is offline
Friend of Wrox
Points: 643, Level: 9
Points: 643, Level: 9 Points: 643, Level: 9 Points: 643, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2008
Location: london, , United Kingdom.
Posts: 153
Thanks: 7
Thanked 1 Time in 1 Post
Default File upload

hi there i have this code
Code:
ProtectedSub Button1_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles btnUpload.Click
If FileUpload1.HasFile Then
Try
FileUpload1.SaveAs("C:\test" & _
FileUpload1.FileName)
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
i need to add an exeption that if file exsists in the directory lbl1.text="file exsists try onother"
__________________
bx
Reply With Quote