Class HTTP::FormData::File
In: lib/http/form_data/file.rb
Parent: Part

Represents file form param.

@example Usage with StringIO

 io = StringIO.new "foo bar baz"
 FormData::File.new io, :filename => "foobar.txt"

@example Usage with IO

 File.open "/home/ixti/avatar.png" do |io|
   FormData::File.new io
 end

@example Usage with pathname

 FormData::File.new "/home/ixti/avatar.png"

Methods

new  

Constants

DEFAULT_MIME = "application/octet-stream"   Default MIME type

External Aliases

content_type -> mime_type
  @deprecated Use content_type instead

Public Class methods

@see DEFAULT_MIME @param [String, Pathname, IO] path_or_io Filename or IO instance. @param [to_h] opts @option opts [to_s] :content_type (DEFAULT_MIME)

  Value of Content-Type header

@option opts [to_s] :filename

  When `path_or_io` is a String, Pathname or File, defaults to basename.
  When `path_or_io` is a IO, defaults to `"stream-{object_id}"`.

[Validate]