Skip to main content

Django uploaded file validation based on file signature.

Project description

file signature validation

Comprehensive tests to validate a file based on file signature. For a Django uploaded file.

Usage

pip install file-signature-validation

Methods

Tests the file name to ensure it is allowed.

regex_file_name_test(uploaded_file, allowed_extensions, regex)

Tests the file to ensure the file signature matches with the corressponeding mime type, extension and given size.

file_type_test(uploaded_file, allowed_type, allowed_mimes, allowed_extensions, allowed_size)

Runs the file through all of the above tests.

acceptable_file(uploaded_file, allowed_types, allowed_mimes, allowed_extensions, allowed_size, regex)

Disclaimer

The authors and contributors of this package can not be held liable for any false positives or damage caused by the use of the file signature validation package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_signature_validation-1.0.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

file_signature_validation-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file file_signature_validation-1.0.0.tar.gz.

File metadata

File hashes

Hashes for file_signature_validation-1.0.0.tar.gz
Algorithm Hash digest
SHA256 84165fd6b595b9603d50e613410266f852a46c283eab4f79aa35ece861f4d27e
MD5 e930a90c84084ff160ba0a694d0b6bc3
BLAKE2b-256 b0742d9fb85e6e6f27a41ebf64e9797af3c1518ad2a405941b741a59954780c0

See more details on using hashes here.

File details

Details for the file file_signature_validation-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for file_signature_validation-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3b81c85ba972aff1f5d9f899b6289aa75676787687010b07b85ef06edbca63a
MD5 17db76d5ac645b6bef22b102666a4a24
BLAKE2b-256 b0b39796bcfa32057ab7bc42c21a4fbc9d5db4b790caf7a6de1dff591098a810

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page