Die relativ neue Dokumenttypen Büro 2007 hat einige Web-Hosts Probleme gegeben, wenn ihre Kunden wollen, um Dokumente zum Download anbieten. Meistens, die Dokumente werden vom Web-Server als angeboten “text / html” was wird dann als eine Tonne Müll auf dem Bildschirm des Web-Benutzers gerendert.
Der beste Weg, dies zu beheben ist, fügen alle MIME Haupttypen der Konfiguration des Servers. IIS7 für Windows hat bereits diese MIME-Typen standardmäßig korrekt eingestellt. IIS6 und IIS5 erfordern die MIME-Typen hinzugefügt werden, als Macht Apache auf älteren Anlagen. Für Apache, es gibt auch einen Workaround für den einzelnen Domain-Inhaber, die MIME-Typen über Apache hinzufügen .htaccess Datei.
IIS 6 MIME-Typ zusätzlich (für das Server Administrator)
Bevor dies geschehen kann,, sicherzustellen, dass der Server auch eingestellt, um direkte Metabasis Bearbeitung zu ermöglichen:
- Last IIS-Manager: Start -> Run, “inetmgr” -> [Ok]
- Rechtsklicken Sie auf “Server” und klicken Sie auf “Properties”
- Innerhalb der “Internet Information Services” Tab (in der Regel die Registerkarte nur), sicherzustellen, dass die “EnLage Direktes Bearbeiten der Metabasis” Kontrollkästchen aktiviert ist.
- Klicken [Ok]
Achten Sie darauf, Sichern IIS Konfigurations (hier für IIS5) vorher. Ich werde keine Verantwortung für den Admin-Server brach sich nicht. Ich habe Grund zu glauben können auch auf IIS5 arbeiten aber ich habe genauso viel Grund, zu glauben, dass es nur geben könnte viele Fehler. Wenn ein IIS5 / Windows- 2000 Admin ist bereit, dies für mich zu testen nach der Sicherung Ihre Konfiguration lassen Sie es mich wissen, die Ergebnisse.
Kopieren Sie den folgenden Text in einer Datei mit dem Namen msoff07-addmime.vbs und ausführen einmal von der Kommandozeile, indem Sie cscript msoff07-addmime.vbs und Drücken der Eingabetaste. Wenn Sie es mehr als einmal ausführen, die MIME-Typen wird jedes Mal hinzugefügt werden, und Sie werden mehrere identische Einträge haben:
'Dieses Skript fügt die notwendige Büro 2007 MIME-Typen auf einem IIS 6 Server.
"Um dieses Skript verwenden, doppelklicken Sie einfach auf oder führen Sie es von der Kommandozeile.
"Wenn Sie dieses Skript mehrfach Ergebnisse in mehrere Einträge in die
'IIS MimeMap so sollten Sie es nicht ausführen mehr als einmal.
"Geändert von http://msdn.microsoft.com/en-us/library/ms752346.aspx
Nicht MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
Const ADS_PROPERTY_UPDATE = 2
"Legen Sie die MIME-Typen hinzugefügt werden
MimeTypesToAddArray = Feld(".docm", "application/vnd.ms-word.document.macroEnabled.12", _
".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", _
".dotm", "application/vnd.ms-word.template.macroEnabled.12", _
".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", _
".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12", _
".potx", "application/vnd.openxmlformats-officedocument.presentationml.template", _
".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12", _
".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", _
".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", _
".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12", _
".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation", _
".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12", _
".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide", _
".xlam", "application/vnd.ms-excel.addin.macroEnabled.12", _
".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12", _
".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12", _
".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", _
".xltm", "application/vnd.ms-excel.template.macroEnabled.12", _
".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template")
"Holen Sie sich das Objekt mimemap
Set MimeMapObj = GetObject("IIS://Localhost / MimeMap")
'Call addMimeType für jedes Paar von Erweiterung / MIME-Typ
Für Zähler = 0 zu UBound(MimeTypesToAddArray) Schritt 2
AddMimeType MimeTypesToAddArray(Zähler), MimeTypesToAddArray(Zähler+1)
Nächste
"Erstellen Sie ein Shell-Objekt
Set WshShell = Create("WScript.Shell")
'Stoppen und starten Sie den IIS-Dienst
Set oExec = WshShell.Exec("net stop w3svc")
Von Während oExec.Status = 0
WScript.Schlaf 100
Schleife
Set oExec = WshShell.Exec("net start w3svc")
Von Während oExec.Status = 0
WScript.Schlaf 100
Schleife
Set oExec = Nichts
'Report Status Benutzer
WScript.Echo "Microsoft Office 2007 Document MIME-Typen registriert."
'AddMimeType Unter
Unter AddMimeType (Ext, MTYPE)
"Holen Sie sich die Zuordnungen aus dem Eigentum MimeMap.
MimeMapArray = MimeMapObj.GetEx("MimeMap")
"Eine neue Zuordnung hinzufügen.
ich = UBound(MimeMapArray) + 1
ReDim Preserve MimeMapArray(ich)
Set MimeMapArray(ich) = Create("MimeMap")
MimeMapArray(ich).Erweiterung = Ext
MimeMapArray(ich).Mimetype = MTYPE
MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
MimeMapObj.SetInfo
Ende Unter |
'Dieses Skript fügt die notwendige Büro 2007 MIME-Typen auf einem IIS 6 Server.
"Um dieses Skript verwenden, doppelklicken Sie einfach auf oder führen Sie es von der Kommandozeile.
' Running this script multiple times results in multiple entries in the
' IIS MimeMap so you should not run it more than once.
"Geändert von http://msdn.microsoft.com/en-us/library/ms752346.aspx
Dim MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
Const ADS_PROPERTY_UPDATE = 2
' Set the MIME types to be added
MimeTypesToAddArray = Array(".docm", "application/vnd.ms-word.document.macroEnabled.12", _
".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", _
".dotm", "application/vnd.ms-word.template.macroEnabled.12", _
".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", _
".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12", _
".potx", "application/vnd.openxmlformats-officedocument.presentationml.template", _
".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12", _
".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", _
".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", _
".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12", _
".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation", _
".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12", _
".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide", _
".xlam", "application/vnd.ms-excel.addin.macroEnabled.12", _
".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12", _
".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12", _
".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", _
".xltm", "application/vnd.ms-excel.template.macroEnabled.12", _
".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template")
' Get the mimemap object
Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap")
' Call AddMimeType for every pair of extension/MIME type
For counter = 0 zu UBound(MimeTypesToAddArray) Schritt 2
AddMimeType MimeTypesToAddArray(Zähler), MimeTypesToAddArray(Zähler + 1)
Next
' Create a Shell object
Set WshShell = CreateObject("WScript.Shell")
' Stop and Start the IIS Service
Set oExec = WshShell.Exec("net stop w3svc")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
Set oExec = WshShell.Exec("net start w3svc")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
Set oExec = Nothing
' Report status to user
WScript.Echo "Microsoft Office 2007 Document MIME-Typen registriert."
' AddMimeType Sub
Sub AddMimeType (Ext, MTYPE)
"Holen Sie sich die Zuordnungen aus dem Eigentum MimeMap.
MimeMapArray = MimeMapObj.GetEx("MimeMap")
"Eine neue Zuordnung hinzufügen.
i = UBound(MimeMapArray) + 1
ReDim Preserve MimeMapArray(ich)
Set MimeMapArray(ich) = Create("MimeMap")
MimeMapArray(ich).Extension = Ext
MimeMapArray(ich).MimeType = MType
MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
MimeMapObj.SetInfo
End Sub
Apache MIME-Typ zusätzlich (für das Server Administrator)
Apache speichert die MIME-Typen in einer Datei liegt normalerweise bei $installpath / conf / mime.types. Siehe die mod_mime Dokumentation für mehr, wie es funktioniert. Arch Linux installiert seine MIME-Typen an /etc / httpd / conf / mime.types und Parallels Plesk installiert es in /usr / local / psa / admin / conf / mime.types. Ihre Verteilung könnte es in einem anderen Ort zu haben, so finden Sie Ihre mime.types Datei, indem Sie lokalisieren mime.types.
Fügen Sie die folgenden Zeilen in die Datei mime.types:
application/vnd.ms-word.document.macroEnabled.12 docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
application/vnd.ms-word.template.macroEnabled.12 dotm
application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
application/vnd.ms-powerpoint.template.macroEnabled.12 potm
application/vnd.openxmlformats-officedocument.presentationml.template potx
application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm
application/vnd.openxmlformats-officedocument.presentationml.slide sldx
application/vnd.ms-excel.addin.macroEnabled.12 xlam
application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
application/vnd.ms-excel.template.macroEnabled.12 xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Apache MIME-Typ zusätzlich (Für den Domain-Inhaber mit mindestens FTP Zugriff – verwenden. htaccess-Datei)
Fügen Sie den folgenden Text zu Ihrer Domain .htaccess Datei, am häufigsten in ein httpdocs / Verzeichnis
AddType application/vnd.ms-word.document.macroEnabled.12 DOCM
AddType Anwendung / vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.ms-word.template.macroEnabled.12 dotm
AddType Anwendung / vnd.openxmlformats-officedocument.wordprocessingml.template DOTX
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType Anwendung / vnd.openxmlformats-officedocument.presentationml.template POTX
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 pPAM
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType Anwendung / vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType Anwendung / vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm
AddType Anwendung / vnd.openxmlformats-officedocument.presentationml.slide sldx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 XLSM
AddType Anwendung / vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType Anwendung / vnd.openxmlformats-officedocument.spreadsheetml.template xltx |
AddType application/vnd.ms-word.document.macroEnabled.12 docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.ms-word.template.macroEnabled.12 dotm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm
AddType application/vnd.openxmlformats-officedocument.presentationml.slide sldx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Letzte Kommentare