The validator IS_UPLOAD_FILENAME does what you want. Just add the regex that check if the extension is the one you want.
requires = IS_UPLOAD_FILENAME(filename='^README$', extension='^(py|java|c)$', case=0) Em terça-feira, 7 de julho de 2015 18:40:55 UTC-3, reddyreddy escreveu: > > Hello, > > I want to allow upload field to be as .c or .java or .py. > I have seen the book that there is a way for uploading images with > different extensions. > Can anyone please let me know how to do it for files. > > Thanks in advance. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.