StaticContentCollection.AddElement(mimeMapElement) ("mimeType").Value = "application/octet-stream" Set mimeMapElement = staticContentCollection.CreateNewElement("mimeMap") Set staticContentCollection = staticContentSection.Collection Set staticContentSection = adminManager.GetAdminSection("system.webServer/staticContent", "MACHINE/WEBROOT/APPHOST/Default Web Site") VBScript Set adminManager = WScript.CreateObject("")ĪdminManager.CommitPath = "MACHINE/WEBROOT/APPHOST/Default Web Site" StaticContentCollection.AddElement(mimeMapElement1) Var mimeMapElement1 = staticContentCollection.CreateNewElement("mimeMap") Var mimeMapElement = staticContentCollection.CreateNewElement("mimeMap") Var staticContentCollection = staticContentSection.Collection Var staticContentSection = adminManager.GetAdminSection("system.webServer/staticContent", "MACHINE/WEBROOT/APPHOST/Default Web Site") JavaScript var adminManager = new ActiveXObject('') ĪdminManager.CommitPath = "MACHINE/WEBROOT/APPHOST/Default Web Site" StaticContentCollection.Add(mimeMapElement1) MimeMapElement1("mimeType") = "text/plain" StaticContentCollection.Add(mimeMapElement)ĭim mimeMapElement1 As ConfigurationElement = staticContentCollection.CreateElement("mimeMap") MimeMapElement("mimeType") = "application/octet-stream" MimeMapElement1 = Imports Systemĭim serverManager As ServerManager = New ServerManagerĭim config As Configuration = serverManager.GetWebConfiguration("Default Web Site")ĭim staticContentSection As ConfigurationSection = config.GetSection("system.webServer/staticContent")ĭim staticContentCollection As ConfigurationElementCollection = staticContentSection.GetCollectionĭim mimeMapElement As ConfigurationElement = staticContentCollection.CreateElement("mimeMap") MimeMapElement = mimeMapElement1 = staticContentCollection.CreateElement("mimeMap") Using (ServerManager serverManager = new ServerManager())Ĭonfiguration config = serverManager.GetWebConfiguration("Default Web Site") ĬonfigurationSection staticContentSection = config.GetSection("system.webServer/staticContent") ĬonfigurationElementCollection staticContentCollection = staticContentSection.GetCollection() ĬonfigurationElement mimeMapElement = staticContentCollection.CreateElement("mimeMap") AppCmd.exe appcmd.exe set config "Default Web Site" -section:system.webServer/staticContent /+""Īppcmd.exe set config "Default Web Site" -section:system.webServer/staticContent /+"" The following code samples add the file types for MIDI System Exclusive (Sysex) Messages and Guitar Tablature (TAB) files to IIS, thereby enabling clients to download these file types. The following configuration sample adds the file types for MIDI System Exclusive (Sysex) Messages and Guitar Tablature (TAB) files to IIS, thereby enabling clients to download these file types. See the Default Configuration section later in this topic for the complete list of default values. Specifies the type of file and the application that uses this kind of file name extension. See the Default Configuration section later in this topic for the complete list of default values Specifies a unique file name extension for a MIME type. In the Add MIME Type dialog box, add the file name extension and MIME type, and then click OK. In the Home pane, double-click MIME Types. In the Connections pane, go to the site, application, or directory for which you want to add a MIME type. Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.On the taskbar, click Start, and then click Control Panel.If you are using Windows Vista or Windows 7: On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager. ![]() If you are using Windows Server 2008 or Windows Server 2008 R2:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |