Verifying files by checking mime-type is not reliable. They don't reliably describe file content, it's just like a label on a closed box. The label can say your box has diamonds inside, but in reality it may contain potatoes.
Imagine that you have a web application that displays user uploaded JPG files. If you code your script to accept every file with mime-type "image/jpeg", somebody can easily spoof that mime-type and upload an executable file to your server.
The best way to determine what the file really is, is by checking it's content. In case of JPG files, you can check the file by checking the "
magic byte" and for valid
JPEG header.
In your case, if you want to check if the downloaded .LIF file is valid, I would simply check if the first line of the file equals to "#Life 1.05". A file with "text/plain" mimetype can be anything.
I took a look at your website, the animation looks great. This is impressive that you learn JavaScript and built such application without any third-party libraries. This is really great Peter, great work.