Link to home
Start Free TrialLog in
Avatar of pvg1975
pvg1975Flag for Argentina

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
ASKER CERTIFIED SOLUTION
Avatar of StormyWaters
StormyWaters
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvg1975

ASKER

Thanks for the promt answer StormyWaters!

The error I get is: Error: 'obj' is undefined. I don't know how to solve it sorry
Avatar of pvg1975

ASKER

Solved. Thanks!