Issue #1195 invalid

Uploads broken on windows 7 x64

Anonymous created an issue

Running

def addimage(self, **params):
    up_file = params['image1']
    f = open(up_file.filename,'w')
    while True:
      data = up_file.file.read()
      f.write(data)
      if not data:
        break
    f.close()

on windows 7 x64 (Cherrypy 3.2.2) produces a broken file after uploading. This code executes fine on my debian box.

This is the image I used.

Before

After

I suspect it has to do with newline chars on windows. Using the same code but uploading a text file produces a file with double the line count

Comments (3)

  1. Log in to comment