I currently have a django formset with dynamic number of forms. Each form has a file field.
While this works, I need a way to allow multiple files to be selected at once. I can do that with input type='file' multiple='multiple'
and I can read file data using FileReader
. But how can I pass these files to django formset instead of form-0-file
, form-1-file
etc?
I can think of one way - replace FileField
with TextField
, and pass around the base64
encoded file as text, but I'm not sure if it's a good solution.
Just use multiple attribute and use FILES to get all of uploaded files.
base64 encoding maybe not help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With