[Django] #26604: Add example of simple multiple file upload in documentation

7 views
Skip to first unread message

Django

unread,
May 10, 2016, 11:18:24 PM5/10/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------+-------------------------------------------------
Reporter: zxcq544 | Owner: nobody
Type: New | Status: new
feature |
Component: | Version: 1.9
Documentation | Keywords: doumentation, multiple file upload,
Severity: Normal | upload many files
Triage Stage: | Has patch: 0
Unreviewed |
Easy pickings: 0 | UI/UX: 0
-------------------------+-------------------------------------------------
At https://docs.djangoproject.com/en/1.9/topics/http/file-uploads/ we
could add simple example of multiple file upload:

In views.py
{{{
def handle_uploaded_files(files):
for i in files:
with open('uploads/' + i.name, 'wb+') as destination:
for chunk in i.chunks():
destination.write(chunk)


def upload_file(request):
if request.method == 'POST':
handle_uploaded_files(request.FILES.getlist('files[]'))
return render(request, 'upload.html')
}}}

In upload.html

{{{
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<input type="file" name="files[]" multiple>
<input type="submit" value="Send">
</form>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26604>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 12, 2016, 12:00:28 PM5/12/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: 1.9
Severity: Normal | Resolution:
Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:1>

Django

unread,
May 15, 2016, 3:04:51 AM5/15/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner:
| berkerpeksag
Type: New feature | Status: assigned

Component: Documentation | Version: 1.9
Severity: Normal | Resolution:
Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by berkerpeksag):

* owner: nobody => berkerpeksag
* status: new => assigned
* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/6603

--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:2>

Django

unread,
Jun 1, 2016, 10:06:59 AM6/1/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner:
| berkerpeksag
Type: New feature | Status: assigned
Component: Documentation | Version: 1.9
Severity: Normal | Resolution:
Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:3>

Django

unread,
Jun 2, 2016, 7:23:30 PM6/2/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner:
| berkerpeksag
Type: New feature | Status: assigned
Component: Documentation | Version: 1.9
Severity: Normal | Resolution:
Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by berkerpeksag):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:4>

Django

unread,
Jun 3, 2016, 5:41:51 PM6/3/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner:
| berkerpeksag
Type: New feature | Status: closed
Component: Documentation | Version: 1.9
Severity: Normal | Resolution: fixed

Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"54febdb8be7c9793caae9c781f4d6b7cbbdcd900" 54febdb8]:
{{{
#!CommitTicketReference repository=""
revision="54febdb8be7c9793caae9c781f4d6b7cbbdcd900"
Fixed #26604 -- Added a multiple file upload example to topics/http/file-
uploads.txt.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:5>

Django

unread,
Jun 3, 2016, 5:42:28 PM6/3/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner:
| berkerpeksag
Type: New feature | Status: closed
Component: Documentation | Version: 1.9
Severity: Normal | Resolution: fixed
Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"27983d82c2415f02d962649b6623a20493b1790b" 27983d82]:
{{{
#!CommitTicketReference repository=""
revision="27983d82c2415f02d962649b6623a20493b1790b"
[1.10.x] Fixed #26604 -- Added a multiple file upload example to
topics/http/file-uploads.txt.

Backport of 54febdb8be7c9793caae9c781f4d6b7cbbdcd900 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:7>

Django

unread,
Jun 3, 2016, 5:42:28 PM6/3/16
to django-...@googlegroups.com
#26604: Add example of simple multiple file upload in documentation
-------------------------------------+-------------------------------------
Reporter: zxcq544 | Owner:
| berkerpeksag
Type: New feature | Status: closed
Component: Documentation | Version: 1.9
Severity: Normal | Resolution: fixed
Keywords: doumentation, | Triage Stage: Accepted
multiple file upload, upload many |
files |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"7407440885f1777abb88f18832ecedc3460f2506" 7407440]:
{{{
#!CommitTicketReference repository=""
revision="7407440885f1777abb88f18832ecedc3460f2506"
[1.9.x] Fixed #26604 -- Added a multiple file upload example to
topics/http/file-uploads.txt.

Backport of 54febdb8be7c9793caae9c781f4d6b7cbbdcd900 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26604#comment:6>

Reply all
Reply to author
Forward
0 new messages