Well i read part of this thread. pardon me if someone already mentioned this.
It has to be written into the code/program.
If I use explorer to browse to the file then no... it aint gonna work. The mechanism to discover the file type is not dependant on the program which views the file. It's kinda like sending a dumb blonde to find the file for "Kendell Jackson" when the name of the file is actually "Kindell Jackson Wine." In this case, it requires a blonde smart enough to add the "Wine" part when she see's the "Kindel Jackson". Maybe, our smart blonde could look INSIDE the file to make sure that's what we wanted.
This can be a tough task for most programmers because there are so many formats and in order for explorer to be smart enough, it has to know what to look for inside the file. The important thing for programmers is to reduce the instructions in a program and make them focus on the task at hand. Extensions allow explorer to do this.
Now tell a blond to file her finger nails and you have gotten something done.