lundi 7 juillet 2014

How do I convert an AWSFile to a simple File in ruby?


Vote count:

0




Currently I am doing it in the following way with a tempfile, but I am assuming that there are better approaches to doing this



@file_to_convert = ... # An Fog::AWSFile
Encoding.default_internal = 'ASCII-8BIT'
tempfile = Tempfile.new(['remote-file', ".xlsx"])
tempfile.write(@file_to_convert.body)
tempfile.close
@converted_file = tempfile


Any help would be appreciated



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire