
Newbie Question: Validate extension of upload file
Dim MyFile
MyFile = "C:\thisisatest\test.doc"
If InStr(MyFile, ".") > 0 And LCase(Right(MyFile, Len(MyFile) -
(InStrRev(MyFile, ".")) + 1)) = ".doc" Then
'Add code to upload file
Else
'Add code to shoot the user for trying to upload invalid file.
End If
Bryan Martin
Quote:
> Hi I would like to know how to go about validating and extention of a file
> on a form. Would like to restrict users to only upload .doc or .xls files.
> Totally new at all of this .. managed to get cdonts working with file
> attachments but haven't the foggiest how to validate the extention ..
> can anyone help please