#11055 closed (fixed)
ImageField uploads fail at r10717
Reported by: | Tim Graham | Owned by: | Armin Ronacher |
---|---|---|---|
Component: | File uploads/storage | Version: | dev |
Severity: | Keywords: | ||
Cc: | Christian Hammond, eallik@…, varikin@…, albrecht.andi@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Attachments (1)
Change History (14)
comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
milestone: | → 1.1 |
---|---|
Owner: | changed from | to
I have a fix for that. The behavior for rewinding slightly changed and i have to figure out how the old code was supposed to rewind.
comment:4 by , 16 years ago
Okay. The best fix is attached as diff. Previously the InMemoryUploadedFile
did the rewinding, but for consistency with temporary file uploads I proposed adding the rewind to the upload finish handler.
comment:5 by , 16 years ago
Has patch: | set |
---|---|
Needs tests: | set |
by , 16 years ago
Attachment: | 11055-rewind-file.patch added |
---|
comment:6 by , 16 years ago
Problem is broader than ImageFields, I hit it with general file upload (where I validate the content as part of cleaning the uploaded file field). I've not looked at the code at all but the attached patch does fix it for my case as well. (I'm surprised we don't have a test that caught this -- I could have sworn I've seen a test that validates uploaded content is as expected.)
comment:7 by , 16 years ago
The attached patch fixes it for any kind of upload. It was a mistake made in the refactoring of the file upload system. The patch attached reverts the old (and intended) behavior, just that the seek is now in a different function for consistency with the other upload backends.
comment:8 by , 16 years ago
Cc: | added |
---|
comment:9 by , 15 years ago
Cc: | added |
---|
comment:10 by , 15 years ago
Cc: | added |
---|
comment:11 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
I get the same problem, might have to do with http://code.djangoproject.com/ticket/8817 - which is the fix I was updating for.