Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use an IO as input file or open it if it is a path

  • Loading branch information...
commit b13ad4d379c83690d6d0881a72b283487dc471c7 1 parent 7d121f4
Maël Clérambault authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/flickraw/api.rb
6 lib/flickraw/api.rb
View
@@ -133,7 +133,11 @@ def process_response(req, response)
def upload_flickr(method, file, args={})
args = build_args(args)
- args['photo'] = open(file, 'rb')
+ if file.respond_to? :read
+ args['photo'] = file
+ else
+ args['photo'] = open(file, 'rb')
+ end
http_response = @oauth_consumer.post_multipart(method, @access_secret, {:oauth_token => @access_token}, args)
process_response(method, http_response.body)
Please sign in to comment.
Something went wrong with that request. Please try again.