nuovo / spreadsheet-reader

A PHP spreadsheet reader (Excel XLS and XLSX, OpenOffice ODS, and variously separated text files) with a singular goal of getting the data out, efficiently
http://www.nuovo.lv/
Other
674 stars 498 forks source link

Cannot read files from another directory #105

Closed sarveshshejwadkar closed 8 years ago

sarveshshejwadkar commented 8 years ago

Code: require DIR.'/spreadsheet-reader/SpreadsheetReader.php';

$ProductsReader = new SpreadsheetReader('C:\UniServerZ\www\new_prj\uploads\771168_20151223_054601_S.xlsx');

foreach ($ProductsReader as $Row) { print_r($Row); }

Above is the code i use to read XLSX files from a subfolder uploads. The scripts throws the below errors. But the script works fine when file is in the same folder as the php script.

Errors: Warning: Invalid argument supplied for foreach() in C:\UniServerZ\www\new_prj\sp readsheet-reader\SpreadsheetReader_XLSX.php on line 371

Warning: XMLReader::open(): Empty string supplied as input in C:\UniServerZ\www\ new_prj\spreadsheet-reader\SpreadsheetReader_XLSX.php on line 959

Warning: XMLReader::read(): Load Data before trying to read in C:\UniServerZ\www \new_prj\spreadsheet-reader\SpreadsheetReader_XLSX.php on line 995 Array ( )

Warning: XMLReader::read(): Load Data before trying to read in C:\UniServerZ\www \new_prj\spreadsheet-reader\SpreadsheetReader_XLSX.php on line 995

adexope commented 7 years ago

please mr Sarvesh123, have u been able to rectify this issue. cuz am having the same problem here.

sarveshshejwadkar commented 7 years ago

@adexope try working with XLS file instead of XLSX

adexope commented 7 years ago

@sarvesh123 thanks a lot,

Klemart3D commented 6 years ago

Same errors for me. I renamed my .xlsx file to .xls but I have : The filename myfile.xls is not readable How did you resolved it ?

sarveshshejwadkar commented 6 years ago

@Klemart3D Sorry, i do not recollect coming across that issue. Could be file permissions