Django File not uploading inlineformset createview

My UpdateView working but I am not understating why file is not uploading in my CreateView?

here is my code:

froms.py

class BlogForm(ModelForm):
    class Meta:  
     model = Blog
     fields = ['title','body']

ImageFormSet = inlineformset_factory(Blog,BlogHeaderImage,fields=('image',),extra=1)

views.py

class BlogCreate(CreateView): #file is not uploading in create view? 
      model = Blog
      template_name = 'blog_post.html'
      form_class = BlogForm

      def get_context_data(self, **kwargs):
        kwargs['latest_posts_list'] = Blog.objects.order_by('-id')
        return super(BlogCreate, self).get_context_data(**kwargs)
      
      def get_context_data(self, **kwargs):
        data = super().get_context_data(**kwargs)
        if self.request.POST:
            data["children"] = ImageFormSet(self.request.POST, self.request.FILES)
        else:
            data["children"] =ImageFormSet()
        return data

      def form_valid(self, form):
        form.instance.author = self.request.user
        context = self.get_context_data()
        children = context["children"]
        self.object = form.save()
        if children.is_valid():
            children.instance = self.object
            children.save()
        return super().form_valid(form)
      def get_success_url(self):
        return reverse("blog")

class BlogUpdate(UpdateView): # Updateview is working and image file is uploading 
      model = Blog
      template_name = 'blog_update_post.html'
      #fields = ['author','title','body']
      form_class = BlogForm
      def get_context_data(self, **kwargs):
        data = super().get_context_data(**kwargs)
        if self.request.POST:
            data["children"] = ImageFormSet(self.request.POST, self.request.FILES, instance=self.object)
        else:
            data["children"] =ImageFormSet(instance=self.object)
        return data
      def form_valid(self, form):
        context = self.get_context_data()
        children = context["children"]
        self.object = form.save()
        if children.is_valid():
            children.instance = self.object
            children.save()
        return super().form_valid(form)
      def get_success_url(self):
        return reverse("blog")

I am also not getting any errors. After click on update button I successfully redirected in Blog page without uploading file.

Notice that you have get_context_data defined twice in your BlogCreate class.

Also note that in your form_valid method you have if children.is_valid(): If the children formset is invalid, you’re ignoring that fact - you’re not doing anything with any errors. So if there is an error in that form, you’re still going to assume that the form was valid and redirect to the success page. (You’re not “getting” any errors, because you’re ignoring them.)

Thanks for your replay. I was missing enctype="multipart/form-data" in my html froms. After add this my problem was solved.