Opened 18 months ago
Last modified 18 months ago
#34582 closed Uncategorized
Uploading multiple files in Django no longer works in version 4.2 but worked in version 4.1 — at Initial Version
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
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;