title: ZipFile to File to FileField Django Python
body: <p>I'm doing a call from a API that give me a zip file with two file in it.
  I manage to extract the file i need (cause it's a PDF)</p>
  <p>and now i just can't find a solution to save it in my filefield without creating the file in my pc.</p>
  <pre class="lang-py prettyprint-override"><code>        with ZipFile(io.BytesIO(response3.content)) as z: # response3 is my response to the API
              for target_file in z.namelist():
                  if target_file.endswith('pdf'):
                      z.extract(member=target_file) # that's how i can have acces to my file and know it is a valid PDF
  
                      # here begin the trick
                      with io.BytesIO() as buf:
                          z.open(target_file).write(buf)
                          buf.seek(0)
                      f = File.open(buf) # File is an import of django.core.files
                      rbe, created = RBE.objects.update_or_create(file=f)
  </code></pre>
  <p>With this code i get an error with write of z.open(...).write as below:</p>
  <pre><code>    z.open(target_file).write(buf)
  io.UnsupportedOperation: write
  
  </code></pre>
  <p>Thanks :)</p>