IS_UPLOAD_FILENAME validator

66 views
Skip to first unread message

黄祥

unread,
Apr 8, 2011, 8:18:36 PM4/8/11
to web2py-users
hi,

i have a problem using validator IS_UPLOAD_FILENAME() to check upload
file neither avi or flv extension, is it support to check multiple
extension like on IS_IMAGE()
e.g.
IS_IMAGE(extensions = ('jpeg', 'png'))
is it support to use
IS_UPLOAD_FILENAME(extensions = ('avi', 'flv'))
thank you

Massimo Di Pierro

unread,
Apr 10, 2011, 5:07:06 PM4/10/11
to web2py-users
IS_IMAGE(extensions = ('jpeg', 'png'))

actually checks the file type by opening it.

IS_UPLOAD_FILENAME(extension = '(avi|flv)')

only checks the extension using regex.
Reply all
Reply to author
Forward
0 new messages