I am trying to use the roo gem to run some operations on an excel File. This works perfectly when I do it manually:
file = File.join(Rails.root, 'october_data.xlsx')
spreadsheet = Roo::Excelx.new(file)
However, this does not work when I upload the file via a form:
file = File.read params["Team Changes"]["document"].path
spreadsheet = Roo::Excelx.new(file)
I get the following error:
ArgumentError (string contains null byte)
There seems to be a lot written about string contains null byte
but nothing I've seen seems relevant to what I'm working on. How do I fix this?