Giter Club home page Giter Club logo

Comments (6)

ryana avatar ryana commented on August 11, 2024

+1 :)

from rubyxl.

weshatheleopard avatar weshatheleopard commented on August 11, 2024

Can you guys please provide more information on reproducing this issue?

from rubyxl.

yogendra689 avatar yogendra689 commented on August 11, 2024

thanks for this awesome gem.
but i m not able to parse xlsx files.

RubyXL::Parser.parse( params['file_to_upload'].tempfile)

where params['file_to_upload'] is >

ActionDispatch::Http::UploadedFile:0xc0fbb9c @original_filename="abc_2014.xlsx", @content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", @headers="Content-Disposition: form-data; name=\"file_to_upload\"; filename=\"abc_2014.xlsx\"\r\nContent-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\r\n", @tempfile=#File:/tmp/RackMultipart20140320-9475-1smhr7c

while parsing it gives: *** RuntimeError Exception: Not .xlsx or .xlsm excel file

is there something i m missing?

error:

` Not .xlsx or .xlsm excel file
raise 'Not .xlsx or .xlsm excel file' unless @skip_filename_check ||
/home/abc/.rvm/gems/ruby-1.9.3-p484@sample/gems/rubyXL-2.4.3/lib/rubyXL/parser.rb:26 : in `parse'
/home/abc/.rvm/gems/ruby-1.9.3-p484@sample/gems/rubyXL-2.4.3/lib/rubyXL/parser.rb:10 : in `parse'

from rubyxl.

weshatheleopard avatar weshatheleopard commented on August 11, 2024

@yogendra689: Yes. You are missing the ability to read and comprehend English language.

Your file is named RackMultipart20140320-9475-1smhr7c

While the gem is expecting the file to have .xlsx or .xlsm extension.

Yes, I know that technically, the extension does not matter, but this validation is the original gem creator's design that I did not get around to fix just yet, as there are many other things that need fixing first. And it helps at times too because it prevents people from trying .xslb files, which this gem is not designed to parse.

As a quick fix, rename your file before passing it to RubyXL.

from rubyxl.

yogendra689 avatar yogendra689 commented on August 11, 2024

but content_type of the file
"Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
indicates its a xlsx file.
is it necessary to specify full file path with extension for parsing?

from rubyxl.

weshatheleopard avatar weshatheleopard commented on August 11, 2024

Yes, it is necessary to specify full file path with extension for parsing.

from rubyxl.

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.