I need to make a form to upload a CSV file. I get the following error when I try to use the form item below:
Only files with the following extensions are allowed: jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp.
$form['data_file'] = array(
'#type' => 'file',
'#title' => t('Data File'),
'#description' => t('CSV file to upload.'),
'#upload_validators' => array(
'file_validate_extensions' => array('csv'),
'file_validate_size' => array(32*1024*1024),
),
);
How can I let a CSV file pass through the validator?