I am trying upload images and than create an thumbnail of it and than store both in S3. After the file has been uploaded i am first uploading it to S3 and than trying to create thumbnail but it doesn’t work as than PIL is not able to recognise the image. And secondly if I create the thumbnail first than while uploading original image I get EOF.
I think Django allows just once for the uploaded files to be used only once….Please kindly tell me a way to do so….Thanks in advance
Uhm, you need to be more specific with your question, but we’re doing the same thing and the workflow is as follows:
1) You get the file handle on file upload from request.FILES and store it somewhere on your local filesystem, so you don’t work on stream — which is what i would guess is causing your problems
2) You use PIL (or better yet, Pillow) to manipulate the image on the FS, do resizing, thumbnailing, whatever.
3) You use Boto (http://boto.cloudhackers.com/en/latest/) to upload to S3, because Boto takes the handling of AWS out of your hands.
It’s quite straightforward and works well