hi i would like to know how I can create a temporary file image (png) in ruby, because tempfile开发者_开发百科 only gets you a random file name but it doesn't have an extension file.
check the documentation!
# Use the Array form to enforce an extension in the filename:
file = Tempfile.new(['hello', '.jpg'])
file.path # => something like: "/tmp/foo2843-8392-92849382--0.jpg"
精彩评论