Thanks Anthony correct Alan i tried this working fine On Thu, Mar 15, 2012 at 10:14 PM, Alan Etkin <spame...@gmail.com> wrote:
> Anthony's answer is the right one, mine is for retrieving the > extension of the url requested > > On 15 mar, 10:40, Anthony <abasta...@gmail.com> wrote: > > 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 >