django filebrowser extensions problem
Posted
by Borislav
on Stack Overflow
See other posts from Stack Overflow
or by Borislav
Published on 2010-04-17T19:53:39Z
Indexed on
2010/04/17
21:53 UTC
Read the original article
Hit count: 367
Hi, I've set django filebrowser's debug to True and wrote the extension restrictions in the model.
pdf = FileBrowseField("PDF", max_length=200, directory="documents/", extensions=['.pdf', '.doc', '.txt'], format='Document', blank=True, null=True)
In django admin it shows correctly with debug info. Directory documents/ Extensions ['.pdf', '.doc', '.txt'] Format Document
But when I call the filebrowser, it allows all file extensions to be uploaded.
How can I restrict filebrowser to upload only certain filetypes that I want?
Thanks everyone
© Stack Overflow or respective owner