title: How to upload and read PDF files in Django
body: <p>I am trying to create a simple <code>django</code> application which takes some <code>PDF</code> files from user and then read its contents. So far I have written the code as mentioned below, But it doesn't seem to work. It's producing an error at this line <code>PyPDF2.PdfFileReader(open(filename))</code></p>
  
  <blockquote>
    <p>TypeError: expected str, bytes or os.PathLike object, not TemporaryUploadedFile</p>
  </blockquote>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;input type="file" name="fupload" multiple&gt;
  </code></pre>
  
  <p><strong>view.py</strong></p>
  
  <pre><code>if request.method == 'POST':
          files = request.FILES.getlist('fupload')
  
          pdf_data = []
          for filename in files:
              read_pdf = PyPDF2.PdfFileReader(open(filename))
              page = read_pdf.getPage(0)
              page_content = page.extractText()
              pdf_data.append(page_content)
  </code></pre>
  
  <p>Can any body tell me what I am doing wrong. Thanks in advance</p>