[Django] #34582: Uploading multiple files in Django no longer works in version 4.2 but worked in version 4.1

15 views
Skip to first unread message

Django

unread,
May 20, 2023, 2:45:39 PM5/20/23
to django-...@googlegroups.com
#34582: Uploading multiple files in Django no longer works in version 4.2 but
worked in version 4.1
-------------------------------------+-------------------------------------
Reporter: bioscom | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 4.2
Uncategorized | Keywords:
Severity: Normal | 'allow_multiple_selected': True
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
In Version 4.1 of Django, I could upload multiple files using the form
codes below.

class ResumeUpload(forms.ModelForm):
class Meta:
model = MyModel
fields = [‘resumes’]
widgets = {
‘resumes’: ClearableFileInput(attrs={‘multiple’: True}),
}

But when I upgraded to version 4.2, the code no longer works, I could not
select multiple files for upload.

I got a post online that says 'allow_multiple_selected': True, in the code
below, should replace ‘multiple’: True as in the code above, but yet it
does not work.

widgets = {
'file':
forms.ClearableFileInput(attrs={'allow_multiple_selected': True})
}

Please, is there any other means to upload multiple files?

Thanks.

Isaac Bejide;

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

Django

unread,
May 20, 2023, 3:34:19 PM5/20/23
to django-...@googlegroups.com
#34582: Uploading multiple files in Django no longer works in version 4.2 but
worked in version 4.1
-------------------------------------+-------------------------------------
Reporter: Bejide, Isaac | Owner: nobody
Type: Uncategorized | Status: closed
Component: File | Version: 4.2
uploads/storage |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
'allow_multiple_selected': True | Unreviewed
Has patch: 0 | Needs documentation: 0

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

* status: new => closed
* resolution: => invalid
* component: Uncategorized => File uploads/storage


Old description:

> In Version 4.1 of Django, I could upload multiple files using the form
> codes below.
>
> class ResumeUpload(forms.ModelForm):
> class Meta:
> model = MyModel
> fields = [‘resumes’]
> widgets = {
> ‘resumes’: ClearableFileInput(attrs={‘multiple’: True}),
> }
>
> But when I upgraded to version 4.2, the code no longer works, I could not
> select multiple files for upload.
>
> I got a post online that says 'allow_multiple_selected': True, in the
> code below, should replace ‘multiple’: True as in the code above, but yet
> it does not work.
>
> widgets = {
> 'file':
> forms.ClearableFileInput(attrs={'allow_multiple_selected': True})
> }
>
> Please, is there any other means to upload multiple files?
>
> Thanks.
>
> Isaac Bejide;

New description:

In Version 4.1 of Django, I could upload multiple files using the form
codes below.
{{{
class ResumeUpload(forms.ModelForm):
class Meta:
model = MyModel
fields = [‘resumes’]
widgets = {
‘resumes’: ClearableFileInput(attrs={‘multiple’: True}),
}
}}}
But when I upgraded to version 4.2, the code no longer works, I could not
select multiple files for upload.

I got a post online that says 'allow_multiple_selected': True, in the code
below, should replace ‘multiple’: True as in the code above, but yet it
does not work.
{{{
widgets = {
'file':
forms.ClearableFileInput(attrs={'allow_multiple_selected': True})
}
}}}
Please, is there any other means to upload multiple files?

Thanks.

Isaac Bejide;

--

Comment:

Your code `attrs={'allow_multiple_selected': True}` isn't correct. Please
read https://docs.djangoproject.com/en/stable/topics/http/file-uploads
/#uploading-multiple-files or see TicketClosingReasons/UseSupportChannels
to get help. This ticket tracker isn't a support channel for asking
questions.

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

Reply all
Reply to author
Forward
0 new messages