﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7812	read() in an InMemoryUploadedFile returns an empty string	Ivan Giuliani	nobody	"If you try to access to .read() in an InMemoryUploadedFile object, you'll get an empty string unless you don't call .seek(0) so it gets to the beginning of the file.

To test, just write a model like this:
{{{
#!python
class TestModel(models.Model):
    photo = models.ImageField(upload_to='test/', validator_list=[validators.CustomValidator()])

    class Admin:
        pass
}}}

And this validator:
{{{
#!python
class CustomValidator(object):
    def __call__(self, field_data, all_data):
        print ""Size: "" + str(field_data.size)
        print ""Len: "" + str(len(field_data.read()))
}}}

We get:
{{{
Size: 378054
Len: 0
}}}

Attached patch solves this issue."		closed	Core (Other)	dev		invalid	upload		Design decision needed	1	0	0	1	0	0
