| Class | UploadIO |
| In: |
lib/composite_io.rb
|
| Parent: | Object |
Convenience methods for dealing with files and IO that are to be uploaded.
| content_type | [R] |
Create an upload IO suitable for including in the params hash of a Net::HTTP::Post::Multipart.
Can take two forms. The first accepts a filename and content type, and opens the file for reading (to be closed by finalizer). The second accepts an already-open IO, but also requires a third argument, the filename from which it was opened.
UploadIO.new("file.txt", "text/plain")
UploadIO.new(file_io, "text/plain", "file.txt")
|
| io | [R] |
Create an upload IO suitable for including in the params hash of a Net::HTTP::Post::Multipart.
Can take two forms. The first accepts a filename and content type, and opens the file for reading (to be closed by finalizer). The second accepts an already-open IO, but also requires a third argument, the filename from which it was opened.
UploadIO.new("file.txt", "text/plain")
UploadIO.new(file_io, "text/plain", "file.txt")
|
| local_path | [R] |
Create an upload IO suitable for including in the params hash of a Net::HTTP::Post::Multipart.
Can take two forms. The first accepts a filename and content type, and opens the file for reading (to be closed by finalizer). The second accepts an already-open IO, but also requires a third argument, the filename from which it was opened.
UploadIO.new("file.txt", "text/plain")
UploadIO.new(file_io, "text/plain", "file.txt")
|
| original_filename | [R] |
Create an upload IO suitable for including in the params hash of a Net::HTTP::Post::Multipart.
Can take two forms. The first accepts a filename and content type, and opens the file for reading (to be closed by finalizer). The second accepts an already-open IO, but also requires a third argument, the filename from which it was opened.
UploadIO.new("file.txt", "text/plain")
UploadIO.new(file_io, "text/plain", "file.txt")
|