D
D
drygoi2017-07-05 13:21:32
PHP
drygoi, 2017-07-05 13:21:32

How to open read-only xls files using Spreadsheet_Excel_Reader?

The Spreadsheet_Excel_Reader library does not open read-only xls files.
In case the $data->sheets file, which is protected from editing, is passed, it turns out to be an empty array.
At transfer of normal xls - everything works.

$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('utf-8');
$data->setUTFEncoder('mb');
$data->read($upload_file);

Clients put a ban on editing files, and removing it is most likely not an option.
Therefore, the question is whether it is possible to solve this problem using the above mentioned library?
If not, are there any other libraries that can open such an excel file?
PS
At first I thought the problem was in encodings or xls versions, but after several checks this version disappeared.
Also, such files have one feature; they cannot be opened using google spreadsheets.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2017-07-05
@nazarpc

Have you tried copying to a temporary file and opening from there?
If you cannot write to the file system and the file fits into memory, then streamWrapper will help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question