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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:34:18+00:00 2026-05-26T08:34:18+00:00

im having a page that will insert username, ID and the user must be

  • 0

im having a page that will insert username, ID and the user must be able to upload upto 10 images .

The main problem that im having is when it comes to uploading multiple images using codeigniter.

  1. can someone suggest me how can i pass each image path of each
    individual image to the array so i can pass it to the database.

  2. and if the user selects to upload less than 10 images, like 2 or 5
    then how can i ignore the error that says a file hasn’t been
    selected and jst pass only the images that has been uploaded.

    <form method="post" action="uploader/go" enctype="multipart/form-data">
    <input name="username" type="text" /><br />
    <input name="nid" type="text" /><br />
    <input type="file" name="image1" /><br />
    <input type="file" name="image2" /><br />
    <input type="file" name="image3" /><br />
    <input type="file" name="image4" /><br />
    <input type="file" name="image5" /><br />
    <input type="file" name="image6" /><br />
    <input type="file" name="image7" /><br />
    <input type="file" name="image8" /><br />
    <input type="file" name="image9" /><br />
    <input type="file" name="image10" /><br />
    <input type="submit" name="go" value="Upload!!!" />
    </form>
    

sample controller

$image_data=array('image_info' => $this->upload->data('image')); 
$image_path=$image_data['image_info']['full_path'];

$data =array(
            'id'=>uniqid('id_'),
                    'nID'=>$this->input->post('nid'),
            'username'=>$username,
            'image1'=>$image_path
}

any help will be appreciated.

  • 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-26T08:34:19+00:00Added an answer on May 26, 2026 at 8:34 am

    change the input names to:

    <input type="file" name="image[1]" /><br />
    <input type="file" name="image[2]" /><br />
    <input type="file" name="image[3]" /><br />
    

    instead and $this->upload->data('image') will be an array.

    And then you can do:

    foreach($this->upload->data('image') as $image) {
       passItToTheDatabase(); // your custom function
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a search page that will have many different search parameters that the
I'm having a little problem with this setup here I have a list of
I'm building a portfolio page that has a list of different projects (in an
I have a interesting problem, my script uses ssh to access my vmware server
I am having this doubt in socket programming which I could not get cleared
Running MS SqlServer from ASP.NET I have a visitors table with no unique key.
I'm building an application (literally, an online application) and I'd like to dynamically call
This morning i rode chapters 39,40 and 41 of the JEE6 tutorial. But i
I'm new here, and quite new to web development in general. My background is
Please excuse the simplicity and length of this, but I have a little test

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.