Yes, you can download it in Heroku into the filesystem.
I doubt theres much space, but you should be able to use the temp file. Most system stores an upload into the temp file system before pushing it somewhere else.
I'm already doing it, since Roo was patch to be able to open Excel files from the stream, but no other type (csv, ods, etc).
def create_temp_file
filename = some_model.some_attachment.blob.filename
@tmp = Tempfile.new([filename.base, filename.extension_with_delimiter], binmode: true)
@tmp.write(ome_model.some_attachment.download)
@tmp.rewind
@tmp
end
# this is how you use it, note the rescue part
def access_the_file
spreadsheet = Roo::Spreadsheet.open(create_temp_file)
# access the spreadsheet as usual
rescue
@tmp&.unlink
end
This preserves the file prefixes and extensions (important to let Roo infer what the file is) and ensures the file get deleted when done.