I've come across an odd issue with the fUpload class. I've created a form to upload a file, and I want to restrict the file type to CSV.
$uploader = new fUpload();
$uploader->setMIMETypes(array('text/csv'), 'The file uploaded in not in CSV format.');
try
{
$file = $uploader->move(UPLOAD_PATH, 'dataFile');
}
catch (fValidationException $e)
{
fMessaging::create('error', fURL::get(), $e->getMessage());
}
Every time I upload a CSV file, I get my error message. However, when I remove the restriction, it works fine. Then when I do the following:
echo $file->getMimeType();
It outputs "text/csv". Any idea what I am doing wrong, or is this a possible bug?