summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-08-28 21:39:17 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-08-28 21:39:17 +0000
commit52914fbf5ae237d7c903f5236e7eed833680367c (patch)
tree50c1143be841d6940b9da38a192a416df259ebc5 /docs
parentfc2978cc45f0fe6d596e7043dc41f4a0b56613bb (diff)
Fixed #8656: added a note about iterating over `UploadedFile` only understanding `\n`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/http/file-uploads.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt
index 6f7c5fbe83..08b0b761dd 100644
--- a/docs/topics/http/file-uploads.txt
+++ b/docs/topics/http/file-uploads.txt
@@ -192,6 +192,21 @@ define the following methods/attributes:
``UploadedFile.temporary_file_path()``
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
===============