sasha85
09-28-2007, 04:09 AM
this is a wonderful asp js that checking that only pdf files will upload
<script language=vbscript>
sub Checkform()
if lcase(right(myfrm.file.value,4)) <> ".pdf" then
alert "not pdf File.Size"
myfrm.reset()
end if
end sub
</script>
<form action=addAttachment.asp enctype="multipart/form-data" method=post name=myfrm id=myfrm>
<input type=file name=file id=file onchange="Checkform()">
<input type=button value="add file">
</form>
i want to export it to jpg and gifs
<script language=vbscript>
sub Checkform()
if lcase(right(myfrm.file.value,4)) <> ".pdf" and lcase(frm.file.value,3)) <> ".jpg" and lcase(right(myfrm.file.value,3)) <> "jpeg" then
alert "not pdf File.Size"
myfrm.reset()
end if
end sub
</script>
<form action=addAttachment.asp enctype="multipart/form-data" method=post name=myfrm id=myfrm>
<input type=file name=file id=file onchange="Checkform()">
<input type=button value="add file">
</form>
i thought that if i will add and\or in the "if", i will solve this...but as you see i was wrong...can you help me?
by the way if someone knows how to check the size of the choosen file in this stage i will be happy like a little girl!:)
<script language=vbscript>
sub Checkform()
if lcase(right(myfrm.file.value,4)) <> ".pdf" then
alert "not pdf File.Size"
myfrm.reset()
end if
end sub
</script>
<form action=addAttachment.asp enctype="multipart/form-data" method=post name=myfrm id=myfrm>
<input type=file name=file id=file onchange="Checkform()">
<input type=button value="add file">
</form>
i want to export it to jpg and gifs
<script language=vbscript>
sub Checkform()
if lcase(right(myfrm.file.value,4)) <> ".pdf" and lcase(frm.file.value,3)) <> ".jpg" and lcase(right(myfrm.file.value,3)) <> "jpeg" then
alert "not pdf File.Size"
myfrm.reset()
end if
end sub
</script>
<form action=addAttachment.asp enctype="multipart/form-data" method=post name=myfrm id=myfrm>
<input type=file name=file id=file onchange="Checkform()">
<input type=button value="add file">
</form>
i thought that if i will add and\or in the "if", i will solve this...but as you see i was wrong...can you help me?
by the way if someone knows how to check the size of the choosen file in this stage i will be happy like a little girl!:)