Re: [Django] #33942: file validator (was: file validator - validating file with mime and magic numbers)

3 views
Skip to first unread message

Django

unread,
Aug 19, 2022, 9:28:34 PM8/19/22
to django-...@googlegroups.com
#33942: file validator
-------------------------------------+-------------------------------------
Reporter: Reza Shakeri | Owner: nobody
Type: New feature | Status: new
Component: File | Version: 4.0
uploads/storage |
Severity: Normal | Resolution:
Keywords: file-validator, | Triage Stage:
file, validator | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Reza Shakeri:

Old description:

> 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

New description:

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

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]

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33942#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages