JordanPatterson28
Dec 29, 2013 - 02:34
I am trying to write a script to upload an image at a public url to my Dropbox. I already have several other scripts uploading text files to Dropbox but he image isn't working. Any ides based on the code below?
import Image
import photos
import sys
import webbrowser
import console
import urllib
from urllib import urlopen
from io import BytesIO
from DropboxLogin import get_client
dropbox_client = get_client()
import clipboard
import keychain
import time
import httplib
url = 'http://313e5987718b346aaf83-f5e825270f29a84f7881423410384342.r78.cf1.rackcdn.com/Pythonista_-_screenshotscopy.PNG'
img = urlopen(url).read()
buffer = Image.open(BytesIO(img))
img.save(buffer, 'PNG')
buffer.seek(0)
response = dropbox_client.put_file('/Public/test.png', buffer)