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

  • Home
  • SEARCH
  • 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 8594297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:09:58+00:00 2026-06-12T00:09:58+00:00

I m trying to upload multiple photos using <input type=’file’> with same name to

  • 0

I m trying to upload multiple photos using

<input type='file'>

with same name to the input element like,

<?php
$remainGal  =   $maxGallery-$totalGallery;
if($remainGal>0){
?>
<div class="businessSPGItems">
<form name="addBusinessGallery" method="post" action="businessservices.php#messageGallery" enctype="multipart/form-data">
<input type="hidden" name="businessID" value="<?php echo $businessID;?>" />
<?php
for($i=0; $i<$remainGal; $i++){
?>
<input type="file" name="filePhotos[]" style="margin-top:5px;" tabindex="<?php echo $i+5; ?>" /><br />
<?php
}
?>
<input type="submit" name="btnAddGallery" value="Add" style="margin-top:10px;" tabindex="<?php echo $i+5; ?>" />
</form>
</div>
<?php
}
?>

But the problem is when i m taking the total count of the file element it always shows 5…
ie.,

<?php 
$photos     =   $_FILES["filePhotos"];
echo count($photos);
?>

So i could not upload more than 5 photos at a time….
i dont know i m doing the correct method..
help please,,
thanks…

  • 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-12T00:09:59+00:00Added an answer on June 12, 2026 at 12:09 am

    Your $_FILES["filePhotos"]; will have an array of values.

    Read: http://php.net/manual/en/features.file-upload.multiple.php

    …the arrays $_FILES[‘userfile’], $_FILES[‘userfile’][‘name’],
    and $_FILES[‘userfile’] [‘size’] will be initialized…
    Each of these will be a numerically indexed array of the appropriate
    values for the submitted files.

    $_FILES["filePhotos"]["name"][0];
    $_FILES["filePhotos"]["name"][1];
    $_FILES["filePhotos"]["name"][2];
    $_FILES["filePhotos"]["name"][3];
    $_FILES["filePhotos"]["name"][4];
    

    Also note that there is an upload limit config value.
    http://php.net/manual/en/ini.core.php#ini.max-file-uploads

    The maximum number of files allowed to be uploaded simultaneously.
    Starting with PHP 5.3.4, upload fields left blank on submission do not
    count towards this limit.

    It defaults to 20.

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

Sidebar

Related Questions

I am trying to write a PHP script that can upload multiple files. for($i=0;$i<count($_FILES['uploadimg']['name']);$i++){
I am trying to upload some files using the multiple upload file field. The
I'm trying to make a multi file uploader. I'm using Multiple File Upload Magic
I'm trying to upload images to a php file, everything works, but sometimes when
I am using Codeigniter and I am trying to upload multiple files into a
I'm trying to create a simple file upload form for my website. I'm using
I am trying to upload multiple photos into a photoset post to Tumblr. I
I am trying to upload multiple photos to my server, I have it partially
I am trying to upload multiple images using meioupload which works fine if I
I let users to upload photos. User can upload multiple photos at once using

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.