I am trying to upload an image hosted on a third party server. Here is the code I am using:
def saveEdit(request):
image = request.REQUEST.get('image','')
title = request.REQUEST.get('title','')
type = request.REQUEST.get('type','')
state = request.REQUEST.get('state','')
cimage = cloudinary.uploader.upload(image, public_id = 'img_'+request.user.__str__()+"_"+title, format='jpg')
return HttpResponse('Got '+image + " type: "+type + " state: "+state + " title:"+request.user.__str__() + "_"+title + " uploaded "+cimage.image.url)
I get the following error:
Invalid image file Request Method: GET Request URL: http://127.0.0.1:8000/saveEdit?image=http://app2.pixlr.com/_temp/507f95e1ec8d8337e5000002.jpg&type=jpg&state=copy&title=13838 Django Version: 1.4.1 Exception Type: Exception Exception Value: Invalid image file Exception Location: /Library/Python/2.7/site-packages/cloudinary/uploader.py in call_api, line 155
I am not sure what I am doing wrong - can you help?
Thanks.