0

So I need a way of validating the sum total of multiple files being uploaded. I know this needs to be done on the client's side but I am not sure how to implement it. Here is the form I amusing:

 <form action="upload.php" method="POST"  enctype="multipart/form-data" >
        <input type="file" name="image[]"  multiple="multiple">
        <input type="submit" value="upload">
 </form>
user1672267
  • 175
  • 1
  • 2
  • 10
  • Check out a similar question here: http://stackoverflow.com/questions/2934788/detecting-file-upload-size-on-the-client-side – user1201210 Sep 24 '12 at 19:09

1 Answers1

0

You can do it in HTML5, something like:

var file = document.getElementById('fileToUpload').files[0];
// now you can get the size via: 
var fileSize = file.size;
Nir Alfasi
  • 53,191
  • 11
  • 86
  • 129