sobota, 21. februar, 2009 | Avtor:

Razmeroma nove vrste dokumentov Pisarna 2007 je dal Nekateri spletni gostitelji težav, ko svojim strankam želimo ponuditi dokumentov za prenos. Najpogosteje, dokumente, ki jih spletni strežnik, kot je na voljo “text / html” ki se nato postanejo kot tono smeti na zaslonu spletne uporabnikov.

Najboljši način za rešitev te težave je, da dodate vse MIME Vrste na glavno konfiguracijo strežnika. IIS7 za Windows že ima te vrste MIME pravilno nastavljena privzeto. IIS6 in IIS5 zahtevajo vrste MIME, ki se dodajajo, Ker bi Apache na starejših napravah. za Apache, obstaja tudi workaround za posameznega lastnika domene dodati vrste mime preko Apache je .htaccess datoteka.

IIS 6 MIME tip dodatek (za Server Administrator)

Preden se to lahko stori, zagotoviti, da je strežnik nastavljen tako, da bo neposredno urejanje metabase:

  1. Load IIS Manager: Začetek -> Run, “inetmgr” -> [v redu]
  2. Desno kliknite “strežnik” in kliknite “Properties”
  3. v okviru “Internet Information Services” tab (običajno le zavihek), zagotovijo, da “Enlahko Direct Metabase Uredi” polje se preverja.
  4. kliknite [v redu]

Bodite prepričani, da nazaj konfiguraciji IIS je (tukaj za IIS5) vnaprej. Ne bo nobene odgovornosti za skrbnika rešuje svojega strežnika. Imam razlog za domnevo, to lahko tudi delo na IIS5 pa imam ravno toliko utemeljeno domneva, da bi lahko samo dati veliko napak. Če na IIS5 / Windows 2000 admin je pripravljen preizkusiti to za mene Po varnostno kopiranje konfiguracija prosim rezultatov.

Kopirajte naslednje besedilo v datoteko z imenom msoff07-addmime.vbs in ga izvrši enkrat iz ukazne vrstice, ki ga tipkanje cscript msoff07-addmime.vbs in pritisnete Enter. Če imate več kot enkrat, vrste MIME bo dodana vsakič, in boste imeli več enakih vnosov:

"Ta scenarij dodaja potrebno urad 2007 Vrste MIME za na IIS 6 Strežnik.
"Za uporabo te skript, samo dvokliknite ali ga izvrši v ukazni vrstici.
"Tek Ta skript večkrat rezultate v več vpisov v
"IIS MimeMap tako da ni treba izvesti več kot enkrat.
Prirejeno iz http://msdn.microsoft.com/en-us/library/ms752346.aspx
 
dim MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
const ADS_PROPERTY_UPDATE = 2 
 
"Nastavitev vrste MIME za dodajanje
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 mimemap predmet
Set MimeMapObj = GetObject("IIS://Localhost / MimeMap")
 
"Call AddMimeType za vsak par razširitev / MIME
za števec = 0 da UBound(MimeTypesToAddArray) Korak 2
    AddMimeType MimeTypesToAddArray(števec), MimeTypesToAddArray(števec+1)
Naslednji
 
"Ustvarjanje Shell predmet
Set WshShell = CreateObject("WScript.Shell")
 
"Ustavite in začeti IIS Service
Set oExec = WshShell.exec("net stop w3svc")
Ali Medtem oExec.Status = 0
    WScript.Sleep 100
Loop
 
Set oExec = WshShell.exec("net start w3svc")
Ali Medtem oExec.Status = 0
    WScript.Sleep 100
Loop
 
Set oExec = nič
 
"Poročilo status uporabnika
WScript.Echo "Microsoft Office 2007 Vrste dokument MIME je bila registrirana."
 
"AddMimeType Sub
Pod AddMimeType (ext, MTYPE)
 
    "Get preslikave iz premoženja MimeMap.
    MimeMapArray = MimeMapObj.GetEx("MimeMap") 
 
    'Dodaj novo preslikavo.
    jaz = UBound(MimeMapArray) + 1
    ReDim Ohrani MimeMapArray(jaz)
    Set MimeMapArray(jaz) = CreateObject("MimeMap")
    MimeMapArray(jaz).razširitev = ext
    MimeMapArray(jaz).MimeType = MTYPE
    MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
    MimeMapObj.SetInfo
 
End Pod

Apache MIME tip dodatek (za Server Administrator)

Apache shranjuje svoje vrste MIME v datoteki običajno nahaja na $installpath / conf / mime.types. Glej mod_mime dokumentacijo Za več informacij o tem, kako deluje. Arch Linux namesti svoje vrste MIME na /etc / httpd / conf / mime.types in Parallels Plesk namesti v /usr / local / PSA / admin / conf / mime.types. Vaša distribucija bi ga imeli v drugem mestu, tako najdejo svoj mime.types datoteke, ki jih izvaja poiskati mime.types.

Dodajte naslednje vrstice v vaši mime.types datoteke:

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 tip dodatek (Za lastnika domene z najmanj FTP dostop – uporabi datoteko .htaccess)

Dodajte naslednje besedilo za svojo domeno je .htaccess datoteka, najpogosteje v httpdocs / imenik

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 spam
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
delež
Kategorija: backup, gostovanje, linux, okna
Lahko sledenje vseh odzivov na to vstop skozi RSS 2.0 feed. Lahko pustite odgovor, ali trackback iz vaše lastne strani.

9 Responses

  1. 1
    Steve 

    I think there is a typo in the vb script for IIS; the .xlt extension should be .xltm. tudi, two more extensions should be added:
    “.sldx”, “application/vnd.openxmlformats-officedocument.presentationml.slide”, _
    “.sldm”, “application/vnd.ms-powerpoint.slide.macroEnabled.12”, _

  2. 2
    Tricky 

    Very interesting, Steve.

    The .xlt isn’t a typo, apparently .xltm is supposed to be the macro-enabled version of .xlt. I’ll do some research and adjust appropriately.

    Thanks!

  3. 3
    Tricky 

    Ah, you’re actually correct, Steve. .xltm/x is new but .xlt is theoldOffice Excel spreadsheet template.

  4. Hi ! It worked for me. Even without changing the direct metabase edit option.

    Cheers!
    Maciej

  5. 5
    Mário Araújo 

    Thanks! 🙂

  6. 6
    R Sleegers 

    Very nicesaved me the trouble of typing them in. “Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect.” ( http://support.microsoft.com/kb/326965 )

  7. 7
    Tricky 

    I’m not sure a recycle is necessary if you’veensure[d] that your server is also set to allow direct metabase editing”, per the article.

  1. […] Source: http://dogma.swiftspirit.co.za/archives/183 […]

  2. […] The original article where the script was found is here. […]

Pustite Odgovori » Se prijavite