Hi,

In my project I am doing file upload size validation for images,documents and videos.

It is possible to check file size using JQuery. I have following example but not giving me result.


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JQuery File Upload</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script  src="jquery.min.js"></script>
 <script type="text/javascript">
        $('#image-file').bind('change', function() {
			alert('Hi');
            alert('This file size is: ' + this.files[0].size/1024/1024 + "MB");
        });
    </script>
</head>

<body>
<form action="upload" enctype="multipart/form-data" method="post">

    Upload image:
    <input id="image-file" type="file" name="file" />
    <input type="submit" value="Upload" />

   

</form>
</body>
</html>
Any Idea?


-Thanks
Zohaib.