i save as an .xls file to an .xlsx file in MSWord2010 and has encountered an error when uploading

Topics: Developer Forum, Project Management Forum, User Forum
Sep 3, 2012 at 9:23 AM

the .xls file behaves normal while the new .xlsx file won't.

The message says 'the filename *** is not recognised as an OLE file'

 

i need help!

Sep 3, 2012 at 9:29 AM

 

//when i  changed  this in PHPExcel\Shared\OLERead.php

     // Check OLE identifier
        if (substr($this->data, 0, 8) != self::IDENTIFIER_OLE) {
            throw new Exception('The filename ' . $sFileName . ' is not recognised as an OLE file');
        }

//to this

     // Check OLE identifier
        var_dump(base64_encode(substr($this->data, 0, 8)));
        if (substr($this->data, 0, 8) != self::IDENTIFIER_OLE) {
            throw new Exception('The filename ' . $sFileName . ' is not recognised as an OLE file');
        }

i got this:

string(12) "UEsDBBQABgA="

Coordinator
Sep 3, 2012 at 10:30 AM

Trying to work out what you're doing here:

Why are you trying to save an .xls file with a .xlsx extension in the first place (assuming that's what you're trying to do)

Sep 4, 2012 at 6:44 AM
MarkBaker wrote:

Trying to work out what you're doing here:

Why are you trying to save an .xls file with a .xlsx extension in the first place (assuming that's what you're trying to do)

We always say that the customer is the God. I need to cope with all kinds of unexpected problems proposed by them.

Coordinator
Sep 4, 2012 at 6:48 AM
Edited Sep 4, 2012 at 6:49 AM

Let PHPExcel decide whether the file is a BIFF format .xls or an OfficeOpenXML .xlsx file automatically by using the IOFactory load() method, or identify() method so it can choose the correct reader in the first place, irrespective of the file extension; but trying to load a BIFF file using the OfficeOpenXML reader or an OfficeOpenXML file using the BIFF file reader simply will not work.

Sep 6, 2012 at 6:48 AM
MarkBaker wrote:

Let PHPExcel decide whether the file is a BIFF format .xls or an OfficeOpenXML .xlsx file automatically by using the IOFactory load() method, or identify() method so it can choose the correct reader in the first place, irrespective of the file extension; but trying to load a BIFF file using the OfficeOpenXML reader or an OfficeOpenXML file using the BIFF file reader simply will not work.

 

Oh,thanks a lot