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

  • Home
  • SEARCH
  • 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 9199017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:25:39+00:00 2026-06-17T22:25:39+00:00

I can upload files perfectly to uploads folder using Codeigniter on localhost. However when

  • 0

I can upload files perfectly to uploads folder using Codeigniter on localhost. However when i try to upload on server i get this error. I have tried different types of files. txt, .doc .xls .jpg etc, which are all fine on localhost. i have looked in MIME file and image/jpeg is in for jpeg along with all the other file types i need (‘doc’ =>’application/msword’, etc etc….).
I have checked folder permissions also and they are ok, but it clear im not even getting that far due to the error.

Does anyone have any ideas why its not allowing me to upload my files.

    string(57) "The filetype you are attempting to upload is not allowed." array(2) 
    { ["testfile"]=> array(5) 
    { ["name"]=> string(7) "123.jpg" ["type"]=> string(10) "image/jpeg" 
    ["tmp_name"]=> string(14) "/tmp/phpVYtNNs" ["error"]=> int(0) ["size"]=> int(20921) }
    ["quotefile"]=> array(5) 
    { ["name"]=> string(7) "123.jpg" ["type"]=> string(10) "image/jpeg" 
    ["tmp_name"]=> string(14) "/tmp/phpIsvQ7x" ["error"]=> int(0) ["size"]=> int(20921) } } 

Controller:

    $config['upload_path'] = './uploads/';
    $config['allowed_types'] = 'gif|jpg|png|txt|pdf|xls|csv|doc';
    $config['max_size'] = '1000000';
    $config['max_width']  = '100024';
    $config['max_height']  = '76008';
    $this->load->library('upload', $config);

Model:

    if ( ! $this->upload->do_upload('testfile'))
    {
        var_dump($this->upload->display_errors('', ''));
                    var_dump($_FILES);
        //$error = array('error' => $this->upload->display_errors());
        //echo '<pre>'; print_r($error); echo '</pre>';
        //$this->load->view('upload_form', $error);     
    }
    else
    {
        $data = array('upload_data' => $this->upload->data('testfile'));
        $this->load->view('upload_success', $data);         
    }
    $upload_data = $this->upload->data('testfile');


    if ( ! $this->upload->do_upload('quotefile'))
    {

        $error = array('error' => $this->upload->display_errors());
        echo '<pre>'; print_r($error); echo '</pre>';
        //$this->load->view('upload_form', $error);
    }
    else
    {
        $data = array('upload_data' => $this->upload->data('quotefile'));
        $this->load->view('upload_success', $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-17T22:25:41+00:00Added an answer on June 17, 2026 at 10:25 pm

    If you are using version 2.1.0, there is a bug in the upload library. Refer the below link, it is explained clearly here.

    Uploading in Codeigniter – The filetype you are attempting to upload is not allowed

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

Sidebar

Related Questions

How can I upload files to server using JSP/Servlet? I tried this: <form action="upload"
I am trying to upload files using php, and it works perfectly up until
As part of a web application users can upload files of data, which generates
I have a system where employees can upload files. There are three ways Upload
If I have form where user can upload files via Ajax (and upload is
I'm building a site where registered users can upload files. Those files are then
I have a form in my django app where users can upload files. How
Can one upload files to a domain other than the domain a script originates
I am trying to write a PHP script that can upload multiple files. for($i=0;$i<count($_FILES['uploadimg']['name']);$i++){
Im currently working on a site that you can upload large files.. on local

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.