Author: jacob
Date: 2008-08-28 16:39:17 -0500 (Thu, 28 Aug 2008)
New Revision: 8685
Modified:
django/trunk/docs/topics/http/file-uploads.txt
Log:
Fixed #8656: added a note about iterating over `UploadedFile` only
understanding `\n`.
Modified: django/trunk/docs/topics/http/file-uploads.txt
===================================================================
--- django/trunk/docs/topics/http/file-uploads.txt 2008-08-28 21:23:21 UTC
(rev 8684)
+++ django/trunk/docs/topics/http/file-uploads.txt 2008-08-28 21:39:17 UTC
(rev 8685)
@@ -192,7 +192,22 @@
``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
===============
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---