$csv_mimetypes = array(
'text/csv',
'text/plain',
'application/csv',
'text/comma-separated-values',
'application/excel',
'application/vnd.ms-excel',
'application/vnd.msexcel',
'text/anytext',
'application/octet-stream',
'application/txt',
);
if (in_array($_FILES['upload'][' type'], $csv_mimetypes)) {
// possible CSV file
// could also check for file content at this point
}
$mimes = array(‘application/vnd.ms-excel’,’text/plain’,’text/csv’,’text/tsv’);
ReplyDeleteif(!in_array($_FILES[‘sf_admin_file’][‘type’],$mimes))
{
$this->form_validation->set_rules(‘sf_admin_file’, ‘Document’, ‘required’);
}