Changes between Version 5 and Version 7 of Ticket #33942


Ignore:
Timestamp:
Aug 19, 2022, 8:40:24 PM (2 years ago)
Author:
Reza Shakeri
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33942

    • Property Summary file validatorfile validator - validating file with mime and magic numbers
  • Ticket #33942 – Description

    v5 v7  
    11I want to add a file validator to Django using the native Python library called mimetypes [https://docs.python.org/3/library/mimetypes.html]
    2 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
     2There 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.
    33
    44I wrote a file validator library using Python, which you can use using the link below and see its codes:
    55[https://github.com/rzashakeri/file_validator]
     6
     7
     8file validator code :
     9https://github.com/rzashakeri/file_validator/blob/cfdb9cc90dba9708d895f18095a8177cd3392779/file_validator/django.py#L92
Back to Top