lib/koala/http_service/uploadable_io.rb in koala-1.7.0rc1 vs lib/koala/http_service/uploadable_io.rb in koala-1.8.0rc1
- old
+ new
@@ -1,6 +1,7 @@
require "net/http/post/multipart"
+require "tempfile"
module Koala
module HTTPService
class UploadableIO
attr_reader :io_or_path, :content_type, :filename
@@ -78,11 +79,11 @@
end
end
# takes a file object
def self.file_param?(file)
- file.kind_of?(File)
+ file.kind_of?(File) || file.kind_of?(Tempfile)
end
def parse_file_object(file, content_type = nil)
if UploadableIO.file_param?(file)
@io_or_path = file
@@ -178,10 +179,10 @@
"video/x-ms-wmv"
end
end
end
end
-
+
# @private
# legacy support for when UploadableIO lived directly under Koala
UploadableIO = HTTPService::UploadableIO
end