Hello Sanjeet for file you dont have to identify the file extension, IN 
model itself you can validate the upload field . Please see the web2py 
cheatsheet and form or table validation its very easy to use. 
And still you want to know the file format please see the module function 
import sys.
On Thursday, 15 March 2012 15:48:10 UTC+5:30, 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
>

Reply via email to