Upload and Read Excel file using (xlrd)

86 views
Skip to first unread message

Nick Ace

unread,
Jul 22, 2012, 6:15:36 AM7/22/12
to google-a...@googlegroups.com
Hi to all,

I know there is a lot of post about this but Iam having a hard time trying them and I just end up in the wall.
I want to upload and read the excelfile and process it. my problem start at upload. the file is uploaded I was able to check the filenam of the uploaded file but I was having a problem reading it through xlrd

mycode:

class UploadHandler(webapp2.RequestHandler):
   
def post(self):
       
# This part of the Code is ok
       
print self.request.POST['file'].filename

       
#1. Reading this does not generate error
        inputfile
= self.request.POST['file']

       
#2. opening it throug xlrd generates an error
        wb
= xlrd.open_workbook( inputfile )

       
#3. tried this one but still i get an error
        wb
= xlrd.open_workbook( file_contents = self.request.get('book1.xls') )



Error is:
500 Internal Server Error
The server has either erred or is incapable of performing the requested operation.

how can i make this right, please help.
Thanks
Reply all
Reply to author
Forward
0 new messages