title: How do you append bytes onto a file inside of a zip file via Python 2.7?
body: <p>I am currently working on a piece of a larger puzzle. For my piece, I have a file object and the destination of the zip file. There is never a time that I am aware of the size of the file object. I only know I have one. There for the zip has to support zip64.</p>
  
  <p>My goal is to take that file object(pointer to the file) and write it to the zip file without loading the entire file into memory. I would like to do this chunk by chunk(especially if the file object is really big). </p>
  
  <p>Any ideas on how I can go about doing this?</p>
  
  <pre><code>import zipfile
  
  
  zip_path = "/tmp/file.zip"
  file_to_zip_path = "/home/ryanb58/Desktop/movie.mp4"
  
  with zipfile.ZipFile(zip_path, mode="w", allowZip64=True) as zip:
      f = open(file_to_zip_path, 'rb')
      while True:
          data = f.read(1024)
          zip.writestr("file.mp4", data)
          if not data:
              break
  </code></pre>
  
  <p>My issue is that when I write the new bytes to the file inside the zip. Upon it finishing, I open the zip and it is just a huge list of small files with the same name, each about 1024bytes in size.  My code above ^^ I am kind of stuck, so any ideas or solutions would be great.</p>