Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#7701 closed (invalid)

Upload handling documentation outdated

Reported by: artagnon Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: upload uploadedfile
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 7 years ago by artagnon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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.

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to invalid
  • Status changed from new to 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 Changed 7 years ago by mtredinnick

  • Resolution invalid deleted
  • Status changed from closed to reopened

Oops, closed too fast. Reopening, since the initial report may well be correct. Comment 1 is not correct, though.

comment:4 Changed 7 years ago by artagnon

  • Resolution set to invalid
  • Status changed from reopened to closed

No initial report is invalid too. My bad. I didn't see the changeset for r7859

comment:5 Changed 4 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

Note: See TracTickets for help on using tickets.
Back to Top