I have to disagree. The extensions are part of the unique filename; that much is well established across different operating systems. The only hack is using extensions to indicate the content type to the OS.
Apple got this right ages ago, by using the resource fork as a place to keep file metadata. They had their own version of MIME types ages ago, whereby they encoded both the file type and the program that created the file in the resource fork. A user could rename a .jpg to a .doc and the OS would still know that it was really a JPEG. Well behaved Linux/UNIX systems do this with magic cookies, but those are really an awful hack.
My opinion FWIW: every file format should start with a MIME header in UTF8, in which the content-type of the "rest" of the file after the header should be kept. The header could always begin with the sequence "Content-type:" to act as a magic cookie indicating the presence of a MIME-header.
So here's a possible JPG file, where [CR][LF] is a carriage-return linefeed sequence:
Content-type: image/jpeg [CR][LF]
[CR][LF]
{old-school binary JPEG data...}
Existing programs should be able to be retrofitted pretty easily: if the input file starts with "Content-type:", skip to the end of the MIME header and do traditional processing from there. Otherwise, assume that it's an old-school file. This allows us to put all sorts of metadata in the file header:
Content-type: image/jpeg
Creator: Adobe Photoshop
Created-on: 2015-03-02T11:23:34Z
Content-disposition: inline; filename="IMG-1234.jpg"
{old-school binary JPEG data...}
One content envelope to rule them all. :-)