To access the extension in the request you can use request.extension:

"...
request.extension: the extension of the requested action. It defaults
to
"html". If the controller function returns a dictionary and does not
specify
a view, this is used to determine the extension of the view file that
will
render the dictionary (parsed from the request.env.path_info).
..."

web2py book, 4.7

On Mar 15, 7:18 am, Sanjeet Kumar <sanjeet....@gmail.com> 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

Reply via email to