I have this code in controller trying to read an .xls file :

********************************
def upload():
    import xlrd

    form = SQLFORM.factory(Field('pago', 'upload',

uploadfolder='/home/user/web2py/applications/pruebas/uploads')).process()

    if form.accepts(request.vars,keepvalues=True):

archivo='/home/lu/web2py/applications/pruebas/uploads/'+form.vars.pago
        book = xlrd.open_workbook(archivo)
        sh = book.sheet_by_index(0)
        columnas = sh.ncols

    return dict(form=form, columnas=columnas)
**********************************

Get this error :
<type 'exceptions.ValueError'> mmap offset is greater than file size



--

--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to