<HTML>
<Head>
<script type="text/javascript">
function disableMe() {
var node = document.getElementById('file1');
if (navigator.appName == 'Microsoft Internet Explorer'){
var oas = new ActiveXObject("Scripting.FileSystemObject");
var d = document.frm1.file1.value;
var e = oas.getFile(d);
var check = e.size;
} else {
var check = node.files[0].fileSize;
}
if (check > 1200000)
{
alert('Your file is to big! ');
return false;
}
}
</script>
<form enctype="multipart/form-data" action="upload_file.php" method="post" class="body" name="frm1">
<td><font size='2'><b>Select a file:</b></font> </td><td><input type='file' id='file1' name='file1'></td></tr><tr><td></td><td>
<input type='submit' value=' Upload File ' id="mybutton" onClick='return disableMe();'>
</form>
No comments:
Post a Comment