Open Samoht1 opened 2 years ago
I'm having the same issue for a few hours now, and I can't find the cause.
(Pdb) self.request.FILES
<MultiValueDict: {}>
(Pdb) form_dict['profile_info'].files
<MultiValueDict: {}>
(Pdb) form_dict['profile_info'].data
<MultiValueDict: {.... 'onboarding_wizard-current_step': ['profile_info'], 'profile_info-avatar_file': ['242434811_582079809594246_1047266963691802278_n.jpg'], 'profile_info-short_description': ['dasd'], 'profile_info-description': ['adad'], 'profile_info-facebook': [''], 'profile_info-soundcloud': [''], 'profile_info-youtube': [''], 'profile_info-instagram': ['']}>
As we can see the 'profile_info-avatar_file': ['242434811_582079809594246_1047266963691802278_n.jpg']
shows a file, but everything else is empty.
I'm using
class OnboardingWizard(LoginRequiredMixin, SessionWizardView):
file_storage = default_storage
but I also tried other approaches with the SystemFileStorage without any luck. Did you figure it out @Samoht1 ?
Adding enctype="multipart/form-data"
to the form worked for me
<form enctype="multipart/form-data" action="" method="post">
@Samoht1 could this be closed?
I have a 5 step form wizard, each their own form. I have a FileField in the first, but something is going wrong. When I reach the final step and press submit, my model gets saved but the file field is empty in my database. It's not "null", but actually empty. I created the "file_storage" variable but that only stores the file temporarily, it get's deleted as soon as I submit the form
this is my wizard class: