﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33942	file validator - validating file with mime and magic numbers	Reza Shakeri	nobody	"I want to add a file validator to Django using the native Python library called mimetypes [https://docs.python.org/3/library/mimetypes.html]
There is a file validator in Django, but it only validates files using the extension, which is not very reliable. According to the documentation, I wrote a file validator that checks the magic numbers (mimes) of the files, and it is more reliable and reliable with It supports the use of native Python libraries and many mimes, This file validator can check the size of files in addition to mimes and validate both of them.

I wrote a file validator library using Python, which you can use using the link below and see its codes:
[https://github.com/rzashakeri/file_validator]


file validator code :
https://github.com/rzashakeri/file_validator/blob/cfdb9cc90dba9708d895f18095a8177cd3392779/file_validator/django.py#L92
"	New feature	new	File uploads/storage	4.0	Normal		file-validator, file, validator		Unreviewed	0	0	0	0	0	0
