Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MIME Types

Options
  • 22-10-2007 1:02pm
    #1
    Closed Accounts Posts: 345 ✭✭


    Hi All,

    Does anyone know of a way of adding MIME Types through DOS ?

    Thanks


Comments

  • Registered Users Posts: 2,426 ✭✭✭ressem


    I think that you'll need to provide a bit more information.

    If I had to guess then I'd say that you meant to add/change a "Registered file type" so clicking on that file type results in the file being opened in a particular program?
    Equivalent to clicking "Explorer\Tools\Folder Options\File Types\New".

    Adding MIME types is usually only needed by web servers, email servers and other services transferring files through the internet, and security programs like antivirus/proxy/firewall. In which case, which server or program are you asking about?


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    ressem wrote: »
    I think that you'll need to provide a bit more information.

    If I had to guess then I'd say that you meant to add/change a "Registered file type" so clicking on that file type results in the file being opened in a particular program?
    Equivalent to clicking "Explorer\Tools\Folder Options\File Types\New".

    Adding MIME types is usually only needed by web servers, email servers and other services transferring files through the internet, and security programs like antivirus/proxy/firewall. In which case, which server or program are you asking about?


    Hi there,

    You are correct, I am trying to do this on a web server, using IIS 6.0 on Windows 2003.
    I have about 12 new MIME Types I have to add in every time a new server comes on board. I'd like to automate this, either by using a batch file or importing the MIME types from another server.
    Currently I have to go into the properties of the web server, MIME types, New, etc etc ..

    Cheers


  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    Currently I have to go into the properties of the web server, MIME types, New, etc etc ..
    Do these changes get added to the registry? If so it might be easy enough to export that part of the registry. Crack open regedit and do a search.
    If it is written to configuration text/ini files then it's even easier.


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    daymobrew wrote: »
    Do these changes get added to the registry? If so it might be easy enough to export that part of the registry. Crack open regedit and do a search.
    If it is written to configuration text/ini files then it's even easier.

    Hi,

    I had a look into this all right, I read somewhere on google it was written into the conf/mime.types file but the entries I added manually through IIS didn't show up in that file.
    I searched the registry for the .extensions and they weren't visible either.
    Kinda stumped.


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Do an IIS metabase backup of a server that is fully configured by not in production. From that file, restore it to your new servers each time. This will update IIS mappings and MIME types for you.

    Have a look at the following http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/43a51d34-7c81-413b-9727-ec9a19d0b428.mspx?mfr=true

    Exporting Metabase elements

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/49521fc7-0b21-4055-b943-87e181dd62d9.mspx


  • Advertisement
  • Closed Accounts Posts: 345 ✭✭FindingNemo


    Ginger wrote: »
    Do an IIS metabase backup of a server that is fully configured by not in production. From that file, restore it to your new servers each time. This will update IIS mappings and MIME types for you.

    Have a look at the following http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/43a51d34-7c81-413b-9727-ec9a19d0b428.mspx?mfr=true

    Exporting Metabase elements

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/49521fc7-0b21-4055-b943-87e181dd62d9.mspx



    Hi Ginger,

    I had a look at this as well but unfortunately I can't use it.
    Each new server I get, comes already configured with about 40 different web sites and about 20 different accounts on these web sites with different permissions, directory security etc etc. If I was to export metabase and everything, that brings over all the directory security etc which I don't want as each server has different accounts,
    hope I make sense !!!

    Cheers


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    From Microsoft :
    ****Mime entries can be added to the following registry location:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\ MimeMap ****


    I have MIME Types but I don't have this directory, I can go up until parameters, no Mimemap though

    :confused:


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Hmm have a look at the elements export.. also metabase edit..

    or have a goo at this like http://www.hanselman.com/blog/ProgrammaticallyAddingMimeTypesToIIS.aspx

    Seems you just need a small bit of script knowledge and you can do it

    How to use mimemap here http://msdn2.microsoft.com/en-us/library/ms525635.aspx


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    still working on this ginger, trying to figure out a way of not using vbscript or anything.

    I'll find something god damn it :-)


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Dont think you will be able to do it just using DOS.. none of the machines will have CScript or WSH installed then???

    You could do it from a central machine and do it remotely that might get you over the hump


  • Advertisement
  • Closed Accounts Posts: 345 ✭✭FindingNemo


    Yeah, doing it remotely seems the way.

    I had a look at the elements export, downloaded the IIS6 resource kit as well,
    unfortunately looks like you can import and export every component apart from MIME Types :rolleyes:


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Using the ADSI object to do it is possibly your only option, you can do remote enabling of WS but not MIME and you can understand why.

    Still maybe you need to see when the machines are being built, are they being ghosted or just pre installed and then handed down in a barebones situation??


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    Ginger wrote: »
    Using the ADSI object to do it is possibly your only option, you can do remote enabling of WS but not MIME and you can understand why.

    Still maybe you need to see when the machines are being built, are they being ghosted or just pre installed and then handed down in a barebones situation??

    Unfortunately the latter pal !!!!


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Hmm

    Just spotted this script

    http://msdn2.microsoft.com/en-us/library/ms752346.aspx#register_mime_types

    Or have a goo here
    Adding all mime-types to IIS in one step is very simple:

    The easiest way to do this is stopping IIS and editing the metabase XML file (C:\WINDOWS\system32\inetsrv\MetaBase.xml) using a text editor. Search for the <IIsMimeMap Location="/LM/MimeMap" …> element and append the lines above to the MimeMap attribute

    From here http://www.bram.us/2007/05/25/office-2007-mime-types-for-iis/


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    FANTASTIC, just tried it manually, did the trick,

    THANKS !!!!


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    God bless the internet and its faithful servant Google


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    too right, I wouldn't have a job if it wasn't for google.
    edit: or boards !!!!


Advertisement