FileField not working properly
FilipeAVS opened this issue Β· comments
Filipe Santos commented
Hey all π
I'm currently working with the Form Wizard to build a multi-step form. I have 5 steps (hence 5 forms), and on the 4th one I'm trying to add a FileField like this:
attachment = forms.FileField()
Very simple and direct. Also, on my view I added this:
class FormWizard(SessionWizardView):
file_storage = FileSystemStorage(location="/media/participation")
...
Also nothing too fancy here. For some reason, this is not working. I can select a file on my form and everything, but when I press to go to the next step, the page only refreshes. Like this:
I followed the documentation so am I missing something? Thank you.
Filipe Santos commented
I was missing the enctype at the form tag in the template:
enctype="multipart/form-data"