filtyp
Filtyp, or file type, is a classification that indicates an electronic file's format and, often, its intended use. The concept is central to how software reads, displays, or executes the contents of a file. Common indicators include the filename extension (such as .txt, .jpg, .pdf), the MIME type assigned by software or web servers (text/plain, image/jpeg, application/pdf), and, for greater reliability, the file's internal signature or header bytes (magic numbers).
Determination of a file type can rely on different signals. Extensions are convenient but can be wrong
Usage: Operating systems and applications map file types to programs that can open or process them, and
Security considerations: Mislabelled extensions can conceal executable code or scripts. Relying solely on extensions is risky;
Examples: image/jpeg (.jpg, .jpeg); image/png (.png); application/pdf (.pdf); text/plain (.txt); application/zip (.zip); for Microsoft Word, .docx
See also: File extension, MIME type, Magic number, File format identification.