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 8435243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:51:46+00:00 2026-06-10T06:51:46+00:00

i am using HTML5 multiple upload feature. <input name=’upload[]’ type=file multiple="multiple" id="profileImages" /> its

  • 0

i am using HTML5 multiple upload feature.

<input name='upload[]' type=file multiple="multiple" id="profileImages" />

its working perfect. Now I have one query

does multiple uploading follow any order while uploading images?

suppose I have 5 images

a.png
b.png
c.png
d.png
e.png

now while uploading images if I select images in below order

a.png, 
b.png,
e.png,
d.png,
c.png

does these images would be uploaded in the same order I select?

means $_FILES['upload']['name'] array will have (using PHP )

[0] =>'a.png',
[1] =>'b.png',
[2] =>'e.png',
[3] =>'d.png',
[4] = >'c.png'

or it depends upon filesize or browser or any other factor/attribute ?


sidenote

further i m storing these images individually in profile_image_table

id(pk ) | profile_id | image_name

answer of above question will make my work easy because if multiple image upload in the order we select then it would be easier to choose one image for main profile image ( using MIN(id) or MAX(id) ) of given profile_id.

  • 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-06-10T06:51:47+00:00Added an answer on June 10, 2026 at 6:51 am

    HTML5 has nothing to do with file uploads where the server is concerned. Period. There is no reliable “order.” As the comments have noted, the actual order resulting from the new HTML5 multiple fields can vary from browser to browser. To understand why, we need to look at what happens when a user-agent (browser) submits a form with multiple file fields to a PHP server.

    When you upload multiple files from an HTML form your browser is doing a couple of things automatically for you:

    1. Sending a Content-Type: multipart/form-data header to inform the remote HTTP server that it’s sending several discrete “blocks” of information within the context of this single request.
    2. Building a raw HTTP message that conforms to the HTTP specification to transport your files using the HTTP protocol.

    The raw HTTP message will look something like this:

    POST /somePath HTTP/1.1
    User-Agent: my-browser-v0.1
    Host: www.example.com
    Content-Length: 42
    Content-Type: multipart/form-data; boundary=--------------------
    
    ------------------------------
    Content-Disposition: form-data; name="file[]" filename="file1.txt"
    Content-Type: text/plain
    
    these were the contents of file1.txt
    ------------------------------
    Content-Disposition: form-data; name="file[]"; filename="file2.txt"
    Content-Type: text/plain
    
    these were the contents of file2.txt
    

    It’s completely up to the browser in which order it places the data from your form. User-Agent sniffing is not really a viable option to determine the ordering. Instead, if the order of the fields is that important (pointless idea, but whatever), you should use a form in which there are a finite number of possible file fields and name them individually. This way you can access the files by their field names in the $_FILES array. After all, you aren’t required to use the new HTML5 feature just because it exists:

    <form action='' method='post' enctype='multipart/form-data'>
      <input name='file1' type=file>
      <input name='file2' type=file>
      <input type='submit'>
    </form>
    

    And in your PHP file access the fields directly by their names. You’ll know which form field name was first because you coded the HTML that way:

    <?php
    $_FILES['file1'];
    $_FILES['file2'];
    

    Perhaps a better solution in your case would be to simply have one file field that is named directly (so you always know it’s the primary field) and then add the multi-select field for users to add further files.

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

Sidebar

Related Questions

below is my simple code using HTML 5 multiple file upload. All i need
I am using the HTML5 File API to upload the file to server. It
I'm using the script from http://webdeveloperplus.com/jquery/ajax-multiple-file-upload-form-using-jquery/ I modified the onComplete to add a link
Here is the code I'm using to upload Multiple Photos with the HTML5 tag.
I'm trying to make a multi file uploader. I'm using Multiple File Upload Magic
When uploading one file using <input type=file /> in Opera, it works as expected.
I have added multiple image upload to my site using HTML api's. I have
I have navigation.html (static coded navigtaion ) file loaded on multiple pages, using jQuery
I'm trying to create a simple file upload form for my website. I'm using
I need to upload multiple files into web server using MVC3 with RAZOR. I

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.