I've got a PHP-based web app that runs on all kinds of my customer's servers, mostly apache, but sometimes IIS. I'm using a bunch of JSON files for storing image URL data to be loaded by flash elements.
Problem: IIS6+ won't load a .json file, it returns a 404 error because it's not a known mime type (why IIS doesn't recognize .json is beyond me).
I've googled this a bunch, and read this SO post:
http://stackoverflow.com/questions/332988/get-iis6-to-serve-json-files-inc-post-get
But I'm trying to figure out a way to convince IIS to accept the JSON files without the user having to contact their webhost and ask them to make a server-wide change. Is this possible? Is there something sort of like a php_ini
setting or some sort of script-based solution to tell IIS that .json's are OK?
If the answer to above is NO, I've read a few places suggesting setting the json file extension to .txt
, which I've confirmed works on the IIS7 server I'm troubleshooting on, with no apparent deleterious effects to the flash elements. If I had to, could I write all of the json files as .txt instead? Would there be any down-sides to doing it that way?