#9591 closed (fixed)
MemoryFileUploadHandler doesn't rewind InMemoryUploadedFile to the beginning
Reported by: | Ivan Sagalaev | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
MemoryFileUploadHandler creates an InMemoryUploadedFile and passes it to storage.save without doing seek(0) beforehand. This contradicts the docstring of storage.save that says "The content should be a proper File object, ready to be read from the beginning."
Patch follows.
P.S. Uploaded files are saved correctly though with the standard FileSystemStorage because it uses .chunks() method of a File object that incidentally does seek(0) before read().
Attachments (2)
Change History (7)
by , 16 years ago
comment:1 by , 16 years ago
Component: | Uncategorized → File uploads/storage |
---|
comment:2 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
Has patch: | set |
---|
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This appears to be fixed. InMemoryUploadFile.init calls seek(0) on the file.
Patch