I'm trying to add a new mime type on our web server so that FileGetMimeType() will return /application/x-sas-data for a .sas7bdat file. I've tried both updating the /etc/mime.types and putting AddType into the httpd.conf file and restarted httpd without success.
Red Hat Linux 7.2
Any help would be appreciated.
There is an article that has options for setting the mimetype. Scroll down to "How to set up your server to send the correct MIME types" to see. If you cannot edit your .htaccess file, there is an option to use code to set the mimetype.
EDIT: BTW.. this whole "your post is awaiting moderation" thing is BS.
I've tried adding a .htaccess file in the directory where the both the .cfm and .sas7bdat file are located. (In my real example, the .sas7bdat file will be in a temp directory outside of the web root.) I've restarted httpd and I get application/octet-stream from my FileGetMimeType() call.
I don't think the coding example will work for me because it appears to assume that you know what the content is that you are delivering to the user. We are white listing several different filetypes.
I've been giving it some thought, and I cannot think of any reason why restarting the httpd didn't get you the proper mimetype. It should have been as simple as that.
Did you follow the instructions for activating the .htaccess file? It's not just a matter of dropping an .htaccess file into the documents - you need to modify a config file. Did you do that?
Here's another link - scroll down to "How to Activate an .htaccess file".
NOTE TO MODERATOR: Can we please be done with the "waiting for moderation" just because I included a link???