Comment 3 for bug 1295005

Revision history for this message
Mayte Montano (mayte-l) wrote :

Hello:

I manage to upload a csv file using the following code:

    def _parse_csv(self):
        """
        :return: list of dict from csv file (line/rows)
        """
        csv_file = tempfile.TemporaryFile('w+')
        csv_file.write(self.filebuffer)
        csv_file.seek(0) # this will send you to the beginning of the file
        reader = UnicodeDictReader(csv_file , fieldnames=self.fieldnames)
        return list(reader)

Can't do the same with xls as file is open inside xlrd.open_workbook method.

Hope this help.

Mayte