#7701 closed (invalid)
Upload handling documentation outdated
Reported by: | artagnon | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | upload uploadedfile | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Methods like UploadedFile.read() and attributes like UploadedFile.file_name are replaced with .data and .filename in the SVN head respectively. Documentation should be updated accordingly
Change History (5)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
An InMemoryUploadedFile
is an UploadedFile
(it's a subclass). So the documentation is correct. Not all file uploaded will return InMemoryUploadedFile
, since large uploads will be saved to disk instead of being stored in memory. Only small uploaded will be handled completely in memory. However you can always use the UploadedFile
methods, regardless of whether it's on-disk or in-memory.
comment:3 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Oops, closed too fast. Reopening, since the initial report may well be correct. Comment 1 is not correct, though.
comment:4 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
No initial report is invalid too. My bad. I didn't see the changeset for r7859
Well actually, the documentation is broken.
"The final piece of the puzzle is handling the actual file data from request.FILES. Each entry in this dictionary is an UploadedFile object" >> correct
UploadedFile.read() >> Wrong! UploadedFile.data returns an InMemoryUploadedFile object. The documention therefore applies to InMemoryUploadedFile objects and not UploadedFile objects.