Changeset 7814 for django/trunk/docs/request_response.txt
- Timestamp:
- 07/01/08 10:10:51 (3 months ago)
- Files:
-
- django/trunk/docs/request_response.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/request_response.txt
r7510 r7814 81 81 82 82 ``FILES`` 83 84 .. admonition:: Changed in Django development version 85 86 In previous versions of Django, ``request.FILES`` contained 87 simple ``dict`` objects representing uploaded files. This is 88 no longer true -- files are represented by ``UploadedFile`` 89 objects as described below. 90 91 These ``UploadedFile`` objects will emulate the old-style ``dict`` 92 interface, but this is deprecated and will be removed in the next 93 release of Django. 94 83 95 A dictionary-like object containing all uploaded files. Each key in 84 96 ``FILES`` is the ``name`` from the ``<input type="file" name="" />``. Each 85 value in ``FILES`` is a standard Python dictionary with the following three 86 keys: 87 88 * ``filename`` -- The name of the uploaded file, as a Python string. 89 * ``content-type`` -- The content type of the uploaded file. 90 * ``content`` -- The raw content of the uploaded file. 91 97 value in ``FILES`` is an ``UploadedFile`` object containing the following 98 attributes: 99 100 * ``read(num_bytes=None)`` -- Read a number of bytes from the file. 101 * ``file_name`` -- The name of the uploaded file. 102 * ``file_size`` -- The size, in bytes, of the uploaded file. 103 * ``chunk()`` -- A generator that yields sequential chunks of data. 104 105 See `File Uploads`_ for more information. 106 92 107 Note that ``FILES`` will only contain data if the request method was POST 93 108 and the ``<form>`` that posted to the request had 94 109 ``enctype="multipart/form-data"``. Otherwise, ``FILES`` will be a blank 95 110 dictionary-like object. 111 112 .. _File Uploads: ../upload_handling/ 96 113 97 114 ``META``
