0

Unable to upload these formate file in codeigniter STEP, STP, IGES, IGS, SLDPRT, 3DM, SAT or X_T

   public function do_upload()
{
        $config['upload_path']          = './uploads/';
        $config['allowed_types']        = 'gif|jpg|png|pdf|step';
        $config['max_size']             = 100000000000;
        //$config['max_width']            = 1024;
       // $config['max_height']           = 768;
        $this->load->library('upload', $config);
        $this->upload->initialize($config);      
        if ( ! $this->upload->do_upload('fileUpload'))
        {
                $error = array('error' => $this->upload->display_errors());
                print_r($error);
        //  echo 'error';
               // $this->load->view('upload_form', $error);
        }else{
              $this->upload->data();
              }

error :- The filetype you are attempting to upload is not allowed

1 Answers1

0

for those file types, just change your config of allowed_types into this to override checking extension:

$config['allowed_types'] = "*";

Before uploading your file, codeigniter check your file's extension first, but your file types are not in application/config/mimes.php so codeigniter does not know and then always return FALSE. Another way is to add your mimes type into mimes.php, you can check out this in this link

Canh
  • 516
  • 1
  • 3
  • 9