Re: xlrd and UploadedFile error

2009-05-05 Thread James Smagala
I'm sure any longtime users of xlrd already know this, but I figured I'd put it out there, since I had trouble tracking it down. xlrd's open_workbook function takes a file_contents argument. If you set that to file_contents=uploaded_file.read(), you can pass .xls sheets directly to it from a Dja

xlrd and UploadedFile error

2009-05-04 Thread James Smagala
Hey All, Can anyone tell me how to read a Djano UploadedFile .xls file with xlrd without resorting to explicitly saving the file to the hard drive? If I attempt to pass my_file.read() directly to xlrd, the error I get is: file() argument 1 must be (encoded string without NULL bytes), not str B