I've used convertXLStoCSV
extensively on many files and it usually works well to convert an Excel file to a .csv.
For some reason on one particular file I keep on getting Failed to load as a DOM Document
and it references /PHPExcel/Reader/HTML.php:435
.
Now, if I manually open the file, save it to my local machine and try again it works fine. I don't have control over the file but clearly there is something unique or corrupt about it.
Can anyone suggest a programmatic option that can open and re-save the file locally?
My code is simply:
if(file_exists('data/file.xls')) {
convertXLStoCSV('data/file.xls', 'data/file.csv');
}