-1

I am using

<input type="file" name="upload_attachment[]" class="buttonupload" multiple/> 

to upload and process files on one HTML form.

Is there a simple way with js/jquery to display number of selected files when someone selects the files from browse button?

2
  • Yes, you can use this plugin called jQuery File Upload. It should sort out your issue. blueimp.github.io/jQuery-File-Upload. ps: there is no other way to help the user but giving to him the link for the demos. =/
    – medina
    Apr 7, 2013 at 10:28
  • This is not related to PHP. Look into the File API
    – Boaz
    Apr 7, 2013 at 10:28

1 Answer 1

1

You can use this.files.length:

$(':file').change(function () {
    $('#numberOfFiles').text(this.files.length + " files selected");
});

Demo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.