Browse files

Fixed #8656: added a note about iterating over `UploadedFile` only u…

…nderstanding `\n`.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
jacobian committed Aug 28, 2008
1 parent fc2978c commit 52914fbf5ae237d7c903f5236e7eed833680367c
Showing with 15 additions and 0 deletions.
  1. +15 −0 docs/topics/http/file-uploads.txt
@@ -192,6 +192,21 @@ define the following methods/attributes:
Only files uploaded onto disk will have this method; it returns the full
path to the temporary uploaded file.
+.. note::
+ Like regular Python files, you can read the file line-by-line simply by
+ iterating over the uploaded file:
+ .. code-block:: python
+ for line in uploadedfile:
+ do_something_with(line)
+ However, *unlike* standard Python files, :class:`UploadedFile` only
+ understands ``\n`` (also known as "Unix-style") line endings. If you know
+ that you need to handle uploaded files with different line endings, you'll
+ need to do so in your view.
Upload Handlers

0 comments on commit 52914fb

Please sign in to comment.