Giter Club home page Giter Club logo

Comments (5)

pilsetnieks avatar pilsetnieks commented on May 16, 2024

It's hard to say anything without the actual file to look at. Can you post the file somewhere to see what the issue is?

from spreadsheet-reader.

rodnikosh avatar rodnikosh commented on May 16, 2024

Thank you for the quick reply.
i tried to post it here , but it only receive image files.

The file is a very simple and basic excel file made with Office 2007 Excel.
just made a new Excel sheet and saved it as xls. thats it...

in order to attach it here, i renamed the xls file extension to "jpg" and added it here as attachment. so just rename it back to xls.

reporttocrm_subs_onerow

from spreadsheet-reader.

pilsetnieks avatar pilsetnieks commented on May 16, 2024

It looks like the file is treated as a text file when uploaded. When I try reading the file from disk, it works fine. It seems that when the file is uploaded, you use the tmp_name as the file path which doesn't give any clue as to the file type, and the library defaults to TXT/CSV instead of XLS.

There are two more parameters to the constructor, I'd suggest setting them as well:

public function __construct($Filepath, $OriginalFilename = false, $MimeType = false)

something like this:

$Reader = new SpreadsheetReader($_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type']);

Those two additional parameters would give more clues as to what type of file it is.

from spreadsheet-reader.

rodnikosh avatar rodnikosh commented on May 16, 2024

ok, thanks, i will try what you wrote.
The file in the system, is indeed called upload/1ae68738-71bb-f6c3-1b84-55af4d759d7b
and not upload/1ae68738-71bb-f6c3-1b84-55af4d759d7b.xls

i will rename it in the code and add the ".xls" before using the constructor.

will update....

from spreadsheet-reader.

rodnikosh avatar rodnikosh commented on May 16, 2024

Yes, it solved the problem.
i added an ".xls" at the end of the file that the system uploads and its working.
thank you!

from spreadsheet-reader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.