Commits

leafstorm  committed 6524126

added documentation on forms

  • Participants
  • Parent commits e1c4ceb

Comments (0)

Files changed (1)

File docs/index.rst

 like rsync.
 
 
+File Upload Forms
+=================
+To actually upload the files, you need to properly set up your form. A form
+that uploads files needs to have its method set to POST and its enctype
+set to ``multipart/form-data``. If it's set to GET, it won't work at all, and
+if you don't set the enctype, only the filename will be transferred.
+
+The field itself should be an ``<input type=file>``.
+
+.. code-block:: html+jinja
+
+    <form method=POST enctype=multipart/form-data action="{{ url_for('upload') }}">
+        ...
+        <input type=file name=photo>
+        ...
+    </form>
+
+
 API
 ===
 Here are the API docs. These are generated directly from the source code.