开发者

temporary image file in ruby

开发者 https://www.devze.com 2023-01-22 10:01 出处:网络
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 documen

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"
0

精彩评论

暂无评论...
验证码 换一张
取 消