1

I want to allow .bmp file format to upload

Here is my code:

            $config = [];
            $config['file_name'] = $filename;
            $config['upload_path'] = $dir;
            $config['allowed_types'] = 'jpg|jpeg|png|gif|bmp|pdf';
            $config['max_size'] = '10000';

            $this->upload->initialize($config);               
            $fileData = $this->upload->data();

but error like The filetype you are attempting to upload is not allowed.

Viral M
  • 261
  • 2
  • 14

1 Answers1

1

You can add

$mimes = array('bmp' => array('image/bmp', 'image/x-windows-bmp', 'image/x-ms-bmp'))

in application/config/mimes.php

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Viral Patel
  • 181
  • 10