howto copy content of upload image into BytesIO object (without create tmp file)

49 views
Skip to first unread message

Hanz

unread,
Dec 30, 2013, 10:52:30 AM12/30/13
to django...@googlegroups.com
Hello all,
i need process uploaded image on the fly - in memory. I don't need create temp file.
I try something like...

.....
userform = UserForm(request.POST, request.FILES)
raw_image = userform.cleaned_data["image"]
content = BytesIO(raw_image.read())
image = Img.open(content)
.....
But i received the result...
.....
Exception Type: OSError
Exception Value: 	
cannot identify image file

Thanks for the advice
Hanz
Reply all
Reply to author
Forward
0 new messages