0
我想上傳託管在第三方服務器上的圖像。這裏是我使用的代碼:django cloudinary通過網址上傳遠程圖像 - 無效的文件名
高清saveEdit(請求):
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)
我收到以下錯誤:
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
我不知道我做錯了 - 你能幫幫我?
謝謝。
當您傳遞一個URL時,可能是上傳方法期待圖像? –