4 Replies Latest reply on Jan 4, 2016 12:47 PM by BigDadi

    Register mime type

    BigDadi

      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

      Apache 2.4.6

      Coldfusion 11

       

      Any help would be appreciated.

        • 1. Re: Register mime type
          WolfShade Level 4

          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.

           

          HTH,

           

          ^_^

           

          EDIT:  BTW.. this whole "your post is awaiting moderation" thing is BS.

          • 2. Re: Register mime type
            BigDadi Level 1

            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.

            • 3. Re: Register mime type
              WolfShade Level 4

              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".

               

              HTH,

               

              ^_^

               

              NOTE TO MODERATOR:  Can we please be done with the "waiting for moderation" just because I included a link???

              • 4. Re: Register mime type
                BigDadi Level 1

                I updated the httpd.conf file under that <Directory> to do the override, but it didn't work.  I'm going to use a work around similiar to this approach:  MagicMIME

                 

                Many thanks for your feedback.