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-0.1.0.tar.gz (7.1 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-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for file_signature_validation-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc175de8c0025e5cfd97309fd1403fbdda0f3b6e21d8043cb8a04e9fda29c018
MD5 2e1fac6651f6aae40b7ac8525f097fd4
BLAKE2b-256 746e0f369131a6334d71f929e76faddba07f01ac99f0a7b3a54bf6a86639b01b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for file_signature_validation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0aace32ffa746c7c57533d1e06bc02b988d4c1ffe7b38b02419a549d4d0f9e1
MD5 b78493b0281fcea708707eb1fbcb83c3
BLAKE2b-256 2d47a8d1f69a3dd48b265f3517419770af571b07cbc85dcaec125fcae2d1a008

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