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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:30:54+00:00 2026-05-22T20:30:54+00:00

I have an html input field, such as <form method=post action=process.php enctype=multipart/form-data> <div> <h3>Files:</h3>

  • 0

I have an html input field, such as

<form method="post" action="process.php" enctype="multipart/form-data">
    <div>
        <h3>Files:</h3>
        <input type="file" multiple="multiple" name="image[]" />
        <input type="submit" value="Upload Image" />
    </div>
</form>

And I want the user to be able to upload multiple files at once. My php for this uses a for loop to cycle through all the files, gathers information on each one, and then uploads them one by one.

for($i = 0;$image['name'][$i] == true;$i++)
{
    //code
}

But this won’t upload more than 20, ending with an error, Notice: Undefined offset: 20 in F:\www\hdp\process.php on line 39. Now, if I were to upload 5 images, it would give me Notice: Undefined offset: 5 in F:\www\hdp\process.php on line 39, but that would be ok because it would still upload all 5 photos (0,1,2,3,4). I need it to upload all the photos the user adds.
I know uploading lots of files at once could be a bad idea, but it is just the site admin, and it’s a photography portfolio site. So he needs to be able to upload a lot of photos at once. And if it’s important, they are being uploaded to a MySQL database.

  • 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-22T20:30:55+00:00Added an answer on May 22, 2026 at 8:30 pm

    I’m a bit confused by the ‘wont upload more than 20’ part… what are you basing this on? You’re getting an error either way it seems.

    Change your for loop to check for isset($image[‘name’][$i]) instead, and you will no longer get an error.

    for($i = 0; isset($image['name'][$i]); $i++)
    {
        //code
    }
    

    As mentioned by yes123, you risk hitting the maximum POST size and should check php.ini.

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

Sidebar

Related Questions

Please see the form HTML code below <form method=post action=register> <div class=email> Email <input
I have an HTML form as follow: <form method=POST action=http://> Username: <input type=text name=username
I have a simple form with some plain html input like bellow using ASP.NET
So I have some html like so: <div id=avatar_choices> <label for=id_choice_0> <input id=id_choice_0 type=radio
Let's say I have an html form. Each input/select/textarea will have a corresponding <label>
I have a HTML form with fields such as name, address, notes, etc. I
I have a page with File html input field and a Submit button as
Is it safe to rely on the data of a html input field set
I want to have a form with an input text field and be able
I have an HTML input box <input type=text id=foo value=bar> I've attached a handler

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.