Monday, December 30, 2013

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

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1b8b38d2-69b8-49cf-8b9e-0b1c95e98d48%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment