Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Trying to upload image #64

Open
anubhav3itb opened this issue Apr 16, 2016 · 2 comments
Open

Trying to upload image #64

anubhav3itb opened this issue Apr 16, 2016 · 2 comments

Comments

@anubhav3itb
Copy link

I am using python to upload image but the changes are not getting reflected.

My code:
client_id = "*_"
client_secret = "_
"
client = ImgurClient(client_id, client_secret)
authorization_url = client.get_auth_url('pin')
credentials = client.authorize('ba35e8a921', 'pin')
client.upload_from_path('/home/anubhav/Desktop/anubhav.jpeg', config=None, anon=True)

Can someone please help?

@mortenson
Copy link

mortenson commented Apr 24, 2016

I'm also unable to upload images, and am getting this error when using upload_from_path to upload an image to a specific album:

Imgur error #400: "You are not the owner of album '*****', which means you can't add images to it. For anonymous albums, use the album deletehash."

Edit: After debugging I found that images were uploading, but as anonymous and not the user I had authenticated as. This was my mistake, as I didn't realize that upload_from_path defaults to using anonymous. That said if would be nice if upload_from_path returned the response from upload so that we could retrieve the URL of the anonymous upload.

@Hurderella
Copy link

@anubhav3itb @mortenson you need to call 'set_user_auth' function and set client.mashape_key val.
and argument 'anon' be written to False. reference here upload

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants