request.vars.image.filename.split('.')[-1] or
import os os.path.splitext(request.vars.image.filename)[1][1:] Anthony On Thursday, March 15, 2012 6:18:10 AM UTC-4, Sanjeet Kumar wrote: > > I have the upload field in table i want to check the file extension from > the controller during the upload i am using :- > > SQLFORM.factory(db.emp_detail) > if form.accepts(request.vars, session): > img = form.vars.image > if file.extension == 'something': > update query >