Comments (6)
+1 :)
from rubyxl.
Can you guys please provide more information on reproducing this issue?
from rubyxl.
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.
@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.
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.
Yes, it is necessary to specify full file path with extension for parsing.
from rubyxl.
Related Issues (20)
- How to change the default data type of a column?
- RubyZip 3.0 will introduce breaking changes that rubyXL will currently depend upon HOT 1
- Got a string with a part missing when i read value from cell. HOT 1
- Cannot open xlsx file using rubyXL HOT 3
- cell and styles.xml HOT 1
- can't change border diagonal
- "Nokogiri::XML::SyntaxError (1:1: FATAL: Document is empty)" on parsing the buffer more than once HOT 1
- GitHub sponsor/open collective HOT 2
- `insert_column` with existing styled cell doesn't set cell `@worksheet`, causing failure in `LegacyCell#validate_worksheet` HOT 1
- How can I make a cell in the sheet dropdown list with accept multiple values? (multiple selection)? HOT 1
- Storage class not found for docProps/app.xml and xl/workbook.xml leading to error opening file
- AWS setup for E-mail processing HOT 1
- MissingFile error during send_file in rails
- Re-open #332
- undefined method `change_row_italics' HOT 1
- Obscure error raised when calling `parse_buffer` with an empty buffer HOT 1
- when i parse a xlsx file, change_contents not found. and how can i change merged cell content? HOT 1
- External link can not write to new file
- `#parse_buffer` unexpectedly modifies input buffer HOT 3
- Error Parsing Xlsx when it has links to other files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubyxl.