Check if file is csv type

//File type Checking:
$mimes = array(‘application/vnd.ms-excel’,’text/plain’,’text/csv’,’text/tsv’);
if(!in_array($_FILES[‘sf_admin_file’][‘type’],$mimes))
{
            $this->form_validation->set_rules(‘sf_admin_file’, ‘Document’, ‘required’);
}
Please follow and like us: