21 May
2005
21 May
'05
3:36 p.m.
I am creating a CMF product. It is simple and will only have an id, title, description and the ability to upload its content. I am wanting to restrict the files uploaded to a certain mime type, specifically .txt files (plain text). I see many products like this: 'filter_content_types' : 0, 'allowed_content_types': (), but can't seem to find an example where it is creating this kind of restriction Can I use filter_content_type and allowed_content_types in this context to help restrict the type (or should I do my check on the file type somewhere else (or in addition to something else like discovering the mimetype from a method in the mimetypes registry product))? Regards, David