pvg1975
asked on
FILE EXTENSION FILTER
Hi guys,
I am using the following script to allow users to upload only .ZIP files:
<script>
function validate(obj) {
if (!/\.zip$/i.test(obj.File1 .value))
{
alert("Only .ZIP files can be uploaded")
return false
}
else
document.all.SubmitButton. disabled = true;
return true
}
</script>
I am trying to change the script in order to allow any extension but .ASP, .HTM, .HTML, .JS, .VBS
I tried everything but is not working (I am not a lazy guy just asking for a solution, I am just new with JS). :o)
Any suggestions?
Thanks!
PVG
I am using the following script to allow users to upload only .ZIP files:
<script>
function validate(obj) {
if (!/\.zip$/i.test(obj.File1
{
alert("Only .ZIP files can be uploaded")
return false
}
else
document.all.SubmitButton.
return true
}
</script>
I am trying to change the script in order to allow any extension but .ASP, .HTM, .HTML, .JS, .VBS
I tried everything but is not working (I am not a lazy guy just asking for a solution, I am just new with JS). :o)
Any suggestions?
Thanks!
PVG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Solved. Thanks!
ASKER
The error I get is: Error: 'obj' is undefined. I don't know how to solve it sorry