Newbie Question: Validate extension of upload file 
Author Message
 Newbie Question: Validate extension of upload file
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



Mon, 13 Sep 2004 05:30:24 GMT  
 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



Mon, 13 Sep 2004 18:17:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie question about making a FTP upload.

2. newbie: count files of a certain extension

3. Using VB6 over intranet to check/upload file components (Newbie)

4. Using VB6 over private intranet to check/upload file components (newbie)

5. Validating/Validated questions

6. Datei Upload per HTTP / File upload via HTTP

7. File extension question

8. file upload question

9. file upload question

10. Question : Uploading a file

11. File upload/download maybe an old question

12. Newbie Question: about file type for .frm files

 

 
Powered by phpBB® Forum Software