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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:05:38+00:00 2026-06-12T21:05:38+00:00

This function cannot upload more than 2 images. If tried produces error, Message :

  • 0

This function cannot upload more than 2 images. If tried produces error,

Message : undefined index:userfile

View
<input name="userfile[]" id="userfile" type="file" multiple="" />

Controller

 function do_upload() {

    $count = count($_FILES['userfile']['size']);

    foreach($_FILES as $key=>$value){
        for($n=0; $n<=$count-1; $n++) {
            $_FILES['userfile']['name']=$value['name'][$n];
            $_FILES['userfile']['type']    = $value['type'][$n];
            $_FILES['userfile']['tmp_name'] = $value['tmp_name'][$n];
            $_FILES['userfile']['error']       = $value['error'][$n];
            $_FILES['userfile']['size']    = $value['size'][$n];   

                $config['upload_path'] = './images/';
                $config['allowed_types'] = 'gif|jpg|png|jpeg';
                                    $config['max_size']       = 0;

            $this->load->library('upload', $config);
            $this->upload->do_upload();
            $data = $this->upload->data();
        }
    }   

}
  • 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-12T21:05:39+00:00Added an answer on June 12, 2026 at 9:05 pm

    You should definitely look into your php.ini max post/upload size. Look for values like:

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = ##M
    
    ; Must be greater than or equal to upload_max_filesize
    post_max_size = ##M
    

    and change the # to values that will suit you

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

Sidebar

Related Questions

I'am very new to google-apps-script. I encounter this error TypeError: Cannot find function getValue
In this loop, req.files.upload.length returns file count when 0, or more than one files
I've looked everywhere for this function and cannot find the header files to make
I cannot get this function to fire off... I'm thinking I need a fresh
I am receiving CmdletInvocationException was unhandled, Cannot invoke this function because the current host
It seems that i cannot access $(this) inside jquery ajax success function. please see
This function gives error: function RefreshGrid(){ window.location.href=Form_ElameMamoreBazdid.aspx; }
When trying to call this function in my code i get the error in
I've got this script and it produces the following error: 001 Checksum failure This
I am having trouble with this function, I cannot seem to get my file

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.