I have a the following code which returns false even if I upload a file with valid extension ?
$file = JRequest::getVar('filename', null, 'files', 'array');
jimport('joomla.filesystem.file');
if(strtolower(JFile::getExt($file)) == 'pdf' || strtolower(JFile::getExt($file)) == 'gif' || strtolower(JFile::getExt($file)) == 'jpg' || strtolower(JFile::getExt($file)) == 'png') {
// ..
}
else {
// ..
}