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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:24:06+00:00 2026-06-11T23:24:06+00:00

This is my view (html) content <tr> <td width=341 class=linkssubhead> Subcategory Image&nbsp;<span class=errormsg>*</span> </td>

  • 0

This is my view (html) content

<tr>
    <td width="341" class="linkssubhead">
        Subcategory Image&nbsp;<span class="errormsg">*</span>
    </td>
    <td width="965" align="left">
        <input type="file" name="subcategory_image" value=""  class="required" />&nbsp;&nbsp;<span class="errormsg"><?php  echo $file_error ; ?> </span>
    </td>       
</tr>
<tr>
    <td width="341" class="linkssubhead">
        Subcategory Banner Image&nbsp;<span class="errormsg">*</span>
    </td>
    <td width="965" align="left">
        <input type="file" name="subcategory_banner_image" value=""  class="required" />&nbsp;&nbsp;<span class="errormsg"><?php  echo $file_error ; ?> </span>
    </td>       
</tr>
<tr>
    <td width="341" class="linkssubhead">
        Subcategory Banner Logo&nbsp;<span class="errormsg">*</span>
    </td>
    <td width="965" align="left">
        <input type="file" name="subcategory_banner_logo" value=""  class="required" />&nbsp;&nbsp;<span class="errormsg"><?php  echo $file_error ; ?> </span>
    </td>       
</tr>

This is my controller

$config_image['allowed_types'] =  'gif|jpg|png';
$config_image['overwrite'] =TRUE;
$config_image['subcategory_image']['upload_path'] = './public/subcategory/';
$config_image['subcategory_banner_image']['upload_path'] = './public/subcategory/bannerimage/';
$config_image['subcategory_banner_logo']['upload_path'] = './public/subcategory/bannerlogo/';
$config_image['subcategory_image']['file_name'] = $this->input->post('subcategory_name');
$config_image['subcategory_banner_image']['file_name'] = 'banner_image_'.$this->input->post('subcategory_name');
$config_image['subcategory_banner_logo']['file_name'] =  'banner_logo_'.$this->input->post('subcategory_name');

$this->load->library('upload', $config_image);
$this->upload->initialize($config_image); 
if (!$this->upload->do_upload(array('subcategory_image','subcategory_banner_image','subcategory_banner_logo')))
{
    $errors = $this->upload->display_errors();
    if ($errors)
    {
        $data['file_error'] = $errors;
        $data['body'] =  $this->load->view('matress_model/add_subcategory',$data,TRUE);
        $this->load->view('page',$data);
    } 
}
else
{
    redirect('fileupload/sucess');
}

After submitting the form I got an error

Severity: Warning
Message: Illegal offset type in isset or empty
Filename: libraries/Upload.php
Line Number: 140

How do I get rid of this and how can I allow multiple files upload?

  • 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-11T23:24:07+00:00Added an answer on June 11, 2026 at 11:24 pm

    Have a separate config array for each image and then upload. like below

    //I have given an exmaple for one image repeat this for others,
    $config_image[0]['allowed_types'] =  'gif|jpg|png';
    $config_image[0]['overwrite'] =TRUE;
    $config_image[0]['subcategory_image']['upload_path'] = './public/subcategory/';
    $config_image[0]['subcategory_image']['file_name'] = $this->input->post('subcategory_name');
    
    
    //Load and initialize the library as below and then upload
    $this->load->library('upload', $config_image[0]);
    $this->upload->initialize($config_image[0]); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a view containing a web view with HTML content. This is
I have this Haml view: !!! strict %html{:xmlns => http://www.w3.org/1999/xhtml} %head %meta{:content => text/html;
I have this view @model IEnumerable<ViewModelRound2> ... <snip> ... @{ using (Html.BeginForm(new { round1Ring3Bids
I use this tab view that developed base on jQuery: https://d2o0t5hpnwv4c1.cloudfront.net/001_Tabbed/site/jQuery.html# I change the
can I use it like this in View? <%= Html.CheckBoxFor(user => user.Role, Administrator)%> and
This is part of my spark partial view (it is called TaskSearch): ${ Html.DropDownList(Search.Status,
On this chapter http://www.linuxfromscratch.org/lfs/view/stable/chapter08/kernel.html root@host# chroot $LFS /usr/bin/env -i \ > HOME=/root TERM=$TERM PS1='\u:\w\$
I want to manipulate HTML using a custom view engine like this: protected override
I got error when I write this code @Html.X().ResourceManager() in view error message :
I have this in my controller. I need my view to generate some HTML,

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.