Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:16:11+00:00 2026-05-23T12:16:11+00:00

I am using HTML 5 Multiple files ability to select multiple files for upload.

  • 0

I am using HTML 5 Multiple files ability to select multiple files for upload. The files come as an array of files in the $_FILES variable. I want to use jQuery to get all the names of the files listed before upload button is clicked.

<input class="pictures-upload" name="multiplePhotos[]" type="file" multiple="multiple" />

I want to append a onchange event that when a person clicks the upload files and selects multiple files, it will take names of all files and append it on the body of html. I am using

$('.upload_button').live('change', function () {
     var li = $('<li />').text($(this).val()),
     $('#body').append(li);

 });

This takes only the last file to be selected. How do I get all the files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:16:12+00:00Added an answer on May 23, 2026 at 12:16 pm

    The input element has a native property of ‘files’ which is a FileList type (i.e. a sequence of File). If you have a look at the W3 spec for the File element, you’ll discover what properties you can access.

    However, long story short, the jQuery val method won’t return what you want. Since ‘files’ is a native property of the input element, you can access it directly using this.files. Then just iterate over the array to get the File objects that you can get get the information for (name, size, type, etc).

    for (var i = 0; i < this.files.length; i++) {
        var file = this.files[i];
        $fileList.append('<li>' + file.name + '</li>');
    }
    

    Look here for the jsFiddle of it: http://jsfiddle.net/jonathon/bdbXk/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML: <select multiple='multiple' size='3'> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> Using
so I have multiple HTML files which I need to get some praticular data
How can I pass multiple variables between PHP files using jquery with json? Ex:
I am trying to use the multiple upload attribute of HTML5 to upload files.
I want any php script which can demonstrate me how to upload multiple files
I am attempting to use the Jquery file upload addon to asynchronously upload files
I am not able to upload multiple files.I am using this code. Here itr.hasNext()
I am using 'Uploadify' Jquery plugin in my MVC 3.0 application to upload multiple
Using HTML 5 together with the DOM is there a way to get the
Currently I'm using PHP to load multiple XML files from around the web (non-local)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.