title: How can we convert uploaded docx file to pdf in django
body: <p>I have created a model which accepts file. I'm trying to convert the uploaded docx file to pdf and display it to the user.
  for the conversion of docx file to pdf I'm trying to use docxtopdf module of python.
  But when I pass my file from <code>request.FILES['Doc]</code> to convert function it gives error :</p>
  <pre><code>TypeError at /convview/
  expected str, bytes or os.PathLike object, not FieldFile
  </code></pre>
  <p>Here i the code from views.py file:</p>
  <pre><code>    def post(self, request, *args, **kwargs):
      form = self.get_form()
      if form.is_valid():
          pdffile=UserConvert(Doc=request.FILES['Doc'])
          pdffile.save()
          convert(pdffile.Doc)
  </code></pre>
  <p>How can we change mime type of files when it is in memory?</p>