alexis-mignon / python-flickr-api

A python implementation of the Flickr API
BSD 3-Clause "New" or "Revised" License
367 stars 108 forks source link

Upload From URL #67

Closed interpegasus closed 8 years ago

interpegasus commented 8 years ago

Hi, I would like to know how to upload to flickr via a fileobject or URL instead of passing a path to the photo file?

Reference: flickr_api.upload(photo_file = "path_to_the_photo_file", title = "My title")

photo_file = urllib.urlopen(photo_url)

Thanks

interpegasus commented 8 years ago

It is possible via the last version, by passing the parameter: photo_file_data

Although it still requires the 'path_to_the_photo_file' parameter.

A pull request will be added to make 'path_to_the_photo_file' optional and pass only the photo_file_data parameter.

Cheers!

alexis-mignon commented 8 years ago

I think I finally understood your concern. You can just give any file name you want to "photo_file" if you use 'photo_file_data'. This is required by the http POST" protocole.

alexis-mignon commented 8 years ago

I have added some examples in the tutorial.