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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:11:48+00:00 2026-05-30T13:11:48+00:00

what my problem is why my code unable to store .png file in database

  • 0

what my problem is why my code unable to store .png file in database and uploads folder, but other than file like .jpg, .gif I successfully insert to database and uploads folder, I had include $config['allowed_types'] = 'png' as well, in addition, here is what I var_dump out the error message “The filetype you are attempting to upload is not allowed.” , Any idea how to solve my problem?

here is my code:

$upload_file_name = '';

$config['upload_path'] = '/var/www/html/uploads/';
$config['allowed_types'] = 'jpg|gif|png';
$config['max_size'] = 100000;
$config['overwrite'] = TRUE;
$this->load->library('upload', $config);
if(!$this->upload->do_upload('receipt_attachment'))
{
    $error = array('error' => $this->upload->display_errors());
    $errormessage = $this->upload->display_errors();
    $this->session->set_flashdata('error', $errormessage);
    redirect('home/add_product');
}else{
    $upload_data = $this->upload->data();
    $upload_file_name = $upload_data['file_name'];
}

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-05-30T13:11:50+00:00Added an answer on May 30, 2026 at 1:11 pm

    Have you taken a look at this thread regarding invalid mime type?
    http://codeigniter.com/forums/viewthread/204725/

    Basically it might be (depending on your version of CI) that you have the older un-patched version that has trouble interpreting some png mime-types.

    Take a read and try those solutions, and/or update to the newest CI code.

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

Sidebar

Related Questions

Were is the problem in code.. i am trying to read the .gif file
I followed other reslted question but still unable to solve this problem. I want
I am facing this issue but unable to resolve. My problem goes like this:
The problem I am facing is that I am unable to store the checked
I have got a simple but strange problem. I am unable to set size
New day, new problem :-) Code: Client Side: void abw_Closed(object sender, EventArgs e) {
Here is the problem from code chef : A set of N dignitaries have
here is my problem : The code (FooController) : NSString *path = [[NSBundle mainBundle]
This issue is somewhat related: Problem with Code Generated by XSD.EXE: Sequence of Elements
I am trying to solve the problem Secret Code on SPOJ , and it's

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.