0

We use Roo to handle the spreadsheets that are upload. Everything works fine.

A request was put in to allow for a zip file with multiple excel docs in it. I went out and added

gem 'rubyzip', '>= 1.0.0'

and ran bundle install. Following the guidelines on https://github.com/rubyzip/rubyzip#reading-a-zip-file I have opened the zip file and have the first entry which is a .xls file. Now for the life of me I can't figure out how to pass the file over to Roo to have it process it.

Do I need to extract it to a specific location and then pass that path? Can I pass it to roo without having to save the file to my /public folder?

cal1801
  • 135
  • 1
  • 11
  • 1
    I think you can read and save the file in a local folder (can be private, not in public folder), and then read it from Roo gem. you'd need a way to name the file so you can find it easy when you want to open it. – unmultimedio Feb 16 '17 at 19:52
  • Thanks, @unmultimedio...thats what I figured. I can make a dir in the public folder that will temp hold these excel docs. However I can't figure out how to make entry.extract point to a specific directory. – cal1801 Feb 16 '17 at 21:06
  • And...I'm and idiot and just figured out how to save to a specific directory. – cal1801 Feb 16 '17 at 21:12
  • Glad you found a way, so it's working now? – unmultimedio Feb 16 '17 at 22:56
  • Yes, I saved the files to a tmp folder. Then read the files from that folder and then sent them over to the Roo processing part of my app. Thanks for the help. – cal1801 Feb 17 '17 at 19:13

0 Answers0