• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Register mime type

Explorer ,
Jan 04, 2016 Jan 04, 2016

Copy link to clipboard

Copied

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.

Views

464

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2016 Jan 04, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 04, 2016 Jan 04, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2016 Jan 04, 2016

Copy link to clipboard

Copied

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???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 04, 2016 Jan 04, 2016

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation