Find upload file size

by Francis 2012-10-15 15:44:59

Find upload file size
Before submit the file, you can find the size of uploads and allow to submit.
Its save the time of upload files when MAXIMUM size file not to be submit.

<script type="text/javascript">
function fileSiz()
{
var node = document.getElementById('files');
var size = node.files[0].fileSize;
alert('File Size = '+size);
return false;
}
</script>

<form enctype="multipart/form-data" action="upload_file.php" method="post">
<td><font size='2'>Select a file:</font> </td><td><input type='file' id='files' name='file'></td></tr><tr><td></td><td>
<input type='submit' value=' Upload File ' id="mybutton" onClick='return fileSiz()'>
</form>
1069
like
0
dislike
0
mail
flag

You must LOGIN to add comments