Author: Joey_Crack | Posted on: 6/5/2007 9:16:22 PM | Views : 284

hi,

i have a file upload function that works fine, but i'm wanting to limit the user to only being able to upload .doc and .pdf files, i've searched the forum for some validation controls, but i can't seem to find anything that's working for me

here is my code so far:


Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim fileName As String = sender.parent.findcontrol("FileUpload1").FileName
        Dim filesize As String = sender.parent.findcontrol("FileUpload1").PostedFile.ContentLength
        Label1.Text = fileName
        Label2.Text = filesize
        If FileUpload1.HasFile Then
            FileUpload1.SaveAs(Se ...

Go to the complete details ...