Opened 2 years ago
Closed 2 years ago
#34582 closed Uncategorized (invalid)
Uploading multiple files in Django no longer works in version 4.2 but worked in version 4.1
| Reported by: | Bejide, Isaac | Owned by: | nobody |
|---|---|---|---|
| Component: | File uploads/storage | Version: | 4.2 |
| Severity: | Normal | Keywords: | 'allow_multiple_selected': True |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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;
Change History (1)
comment:1 by , 2 years ago
| Component: | Uncategorized → File uploads/storage |
|---|---|
| Description: | modified (diff) |
| Resolution: | → invalid |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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.