I'm trying to save an image using the chunks method to handle the case where a user tries to upload a large image:

```
destination = open(incident.Image.path, 'wb+')
for chunk in request.FILES['image'].chunks():
    destination.write(chunk)
destination.close()

```

My problem is I can't get the filepath without first saving something in the Image field like so:

```
fileName = str(int(time.time() * 1000))
imageName = fileName + '.jpg'
incident.Image.save(imageName, request.FILES['image'])

```

My question is how can I get the equivalent of incident.Image.path without first saving the image? I don't want to hardcode the path, and the reason I'm stuck is because I can't get the full filepath without getting the upload\_to portion of the ImageField declaration

**EDIT:**

Ok, I've gotten a little farther but I'm stuck again:

```
imgBuffer = StringIO.StringIO()
for chunk in request.FILES['image'].chunks():
    imgBuffer.write(chunk)

# rotate it
rotate = request.POST['rotation']
im = Image.open(imgBuffer)
im = im.rotate(float(rotate))

incident.Image.save(imageName, ContentFile(imgBuffer))

```

I'm getting IOError cannot identify image file which is thrown at im = Image.open(imgBuffer), any ideas?