title: how to pass initial value of FileField to Formset (in Django)
body: <p>I am trying to populate a Django formset using data from a POST/FILE request. I am able to populate all the fields except the FileField. It seems that <code>initial</code> cannot be used to pass the request.FILE to the FormSet creator function. My question is how to pass the FILE to FormSet.</p>
  
  <p>The model.py</p>
  
  <pre><code>class ArticleForm(forms.Form):
       docfile = forms.FileField()
       subject = forms.Charfield(max_length=128)
  
  ArticleFormSet = formset_factory(ArticleForm, extra=2)
  </code></pre>
  
  <p>the views.py</p>
  
  <pre><code>formset = ArticleFormSet(request.POST, request.FILE)
  #do some other work, and then re-display the POST data
  
  data = formset.cleaned_data
  formset = ArticleFormSet(initial=data)
  
  return render_to_response('some.html',
                            {'formset':formset}
                           )
  </code></pre>