Code: Select all
echo $upload . " upload echo <br />";
echo pathinfo($upload,PATH_INFO_EXTENSION);
function processFile($upload) {
switch (pathinfo($upload, PATH_INFO_EXTENSION)) {
case 'xls':
echo "xls content returned ";
break;
case 'xlsx':
return processExcelXls($upload);
break;
case 'csv':
echo "csv content returned <br />";
return processExcelCsv($upload);
break;
case 'txt':
echo "txt content returned <br />";
return processExcelCsv($upload);
break;
default:
return file_get_contents($upload); //or echo error, however you want to handle the default case
}
}Code: Select all
echo $upload . " upload echo <br />";
echo pathinfo($upload,PATH_INFO_EXTENSION);The bolded output of the $upload echo is an accurate path to a valid file.upload/2_ExportCSV.csv upload echo
Warning: pathinfo() expects parameter 2 to be long, string given in /home/content/38/7901938/html/tfm/import.php on line 72
So... why the warning????
I've tried the following for pathinfo
Code: Select all
echo pathinfo("upload/" . $_SESSION['user_id'] . "_" . $_FILES["file"]["name"],PATH_INFO_EXTENSION);What am I doing wrong???
Thanks so much - all of you - for your advice and counsel.
Pavilion