On click to download the file, direct it to a function which will check for password. The function should look somewhat like this;
Code:
function check(){
var realPassword = 'check';
var password = prompt('Enter the password','');
if(password !=' ' && password !=null)
{
if(password != realPassword)
{
alert("Download not accessible");
}
}
else{
alert("Enter the password");
return false;
}
}
You may still have to do some work on this, but it might just prevent the user from downloading, if password is wrong. Post if you still have any querry.
Bookmarks