Hi I am trying to validate the files that are being uploaded on my site. I want to let people submit only .doc or .html or .pdf.... I have this code written in VBScript but there are some problems with it.
1. It doesn't seem to work even if I attach a .doc..
it keeps giving me that I have to still attach a file... 2.
if I have an extra
statement it gives me a TYPE MISMATCH STRING ERROR... any advise will be greatly appreciated.. thanks a lot.
1. It doesn't seem to work even if I attach a .doc..
it keeps giving me that I have to still attach a file... 2.
if I have an extra
Code:
If Ext <> ".doc" OR ".html" Then
Code:
<!-- Option Explicit
dim validation
dim header
header = "TEST"
dim docFile, str4
docFile = Document.form1.blob.Value
intLong = Len(docFile)
str4 = intLong - intLong + 4
dim Ext
Ext = Right(docFile,str4)
Function form1_OnSubmit
validation = True
If (Document.form1.docName.Value) = "" OR (Document.form1.blob.Value) = "" Then
MsgBox "Please enter required information and click Submit! Thank you", 8, Header
validation = False
End If
If Ext <> ".doc" OR ".html" Then
MsgBox "Please select a valid file", 8, Header
validation = False
End If
If validation = True then
form1_OnSubmit =True
Else
form1_OnSubmit = False
End If
End Function
-->