We are going to upload a document from HTML input & we can find the magic number of that file & from that number we can find the file type of that file.
Magic Number:
Chart for the magic number
Note: Refer chart source for file types Wikipedia.
1. Known Mime Types
2. Common MIME Type
Digital Investigation Site for Magic Numbers - https://asecuritysite.com/forensics/magic
Validate File Extension Demo
Demo module out of the components application.