;;;How to limitation on file type? (e.g. Allow only"gif,jpg,png")
BTW - dont forget .jpeg
I use
JS, this function works a treat:
function validate(formName,fieldName)
{
if (document.formName.fieldName.value=="")
{
alert('Click browse to select a file for upload to proceed');
formName.fieldName.focus();
return (false);
}
if ((/.(gif|jpe?g)$/i.test(document.formName.fieldName.value))==false)
{
alert('You may only upload .jpg, .jpeg, or .gif images (in case sensitive)');
return (false);
}
return(true);
}
I fire it like so:
<FORM NAME="updateForm" METHOD="post" encType="multipart/form-data" onSubmit="return validate(updateForm,File1);">
Your second question is a little tricky to answer with the limited ingformation you give.
Wind is your friend
Matt