Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…derstanding `\n`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 52914fbf5ae237d7c903f5236e7eed833680367c 1 parent fc2978c
Jacob Kaplan-Moss authored

Showing 1 changed file with 15 additions and 0 deletions. Show diff stats Hide diff stats

  1. 15  docs/topics/http/file-uploads.txt
15  docs/topics/http/file-uploads.txt
@@ -192,6 +192,21 @@ define the following methods/attributes:
192 192
     ``UploadedFile.temporary_file_path()``
193 193
         Only files uploaded onto disk will have this method; it returns the full
194 194
         path to the temporary uploaded file.
  195
+        
  196
+.. note::
  197
+
  198
+    Like regular Python files, you can read the file line-by-line simply by
  199
+    iterating over the uploaded file:
  200
+    
  201
+    .. code-block:: python
  202
+        
  203
+        for line in uploadedfile:
  204
+            do_something_with(line)
  205
+            
  206
+    However, *unlike* standard Python files, :class:`UploadedFile` only
  207
+    understands ``\n`` (also known as "Unix-style") line endings. If you know
  208
+    that you need to handle uploaded files with different line endings, you'll
  209
+    need to do so in your view.
195 210
 
196 211
 Upload Handlers
197 212
 ===============

0 notes on commit 52914fb

Please sign in to comment.
Something went wrong with that request. Please try again.