Hi we’ve some users that have posted .docx files but when others try and download them they download as zip archives.
Is there anything in EE we can do to stop this?
Thanks,
Ben
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
November 24, 2010 5:40am
Subscribe [5]#1 / Nov 24, 2010 5:40am
Hi we’ve some users that have posted .docx files but when others try and download them they download as zip archives.
Is there anything in EE we can do to stop this?
Thanks,
Ben
#2 / Nov 24, 2010 10:08am
Hi, lotusman.
You’ll need to manually edit the /system/lib/mimes.php file to add that setting. Does that help?
#3 / Nov 25, 2010 5:35am
Hi I’ve checked the mimes.php and I have a record that states
'docx' => 'application/msword',but under IE it still wants to zip it?
Example of docx file on this page:
http://www.stroodacademy.org/index.php/homework2/homework7/category/history/
Any other ideas?
#4 / Nov 27, 2010 3:20pm
Hi lotusman,
I can’t see a .docx download link on that page but are the files directly linked on the site pages or are they delivered via another method i.e. a file protector or similar? What happens with browsers other than IE?
Cheers
Greg
#5 / Nov 29, 2010 12:46pm
Hi Greg,
Thanks for your reply.
I’ve had the school post another file, they changed the last one without me knowing!
So, here’s a docx that when downloaded in IE wants to zip?
http://www.stroodacademy.org/index.php/homework2/homework13/category/art/
Ben
#6 / Nov 29, 2010 5:10pm
Works in all browsers available to me. That said, your MIME type is “text/plain” when it’s clearly binary data, so I assume IE makes a guess at .zip. The newer .docx files should have a MIME type of
application/vnd.openxmlformats-officedocument.wordprocessingml.documentYour server probably needs to be configured accordingly.
#7 / Nov 29, 2010 5:40pm
Thanks Ingmar.
Where did you get the MIME type is “text/plain”? I checked the /system/lib/mimes.php and I have
'docx' => 'application/msword',are you saying that I need to change it to:
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',/confused
Any pointers on server configuration? I guess I need to talk to my host?
#8 / Nov 30, 2010 3:11am
lotusman,
Where did you get the MIME type is “text/plain”?
Because IE is trying to interpret the MIME typee and guessing at text/plain because application/msword does not match docx
Try changing your MIME type to what Ingmar has suggested which is suitable for the newer docx
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',#9 / Nov 30, 2010 3:31am
Ok I’ve changed that to as above.
Client is still having probls with IE and these files?
Can someone explain what Ingmar means about server configuring properly?
Thanks
#10 / Nov 30, 2010 8:21am
OK to make this work on my apache server I’ve added the following in a .htaccess at root level.
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
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-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 xltxHope this helps anyone else…
#11 / Nov 30, 2010 3:41pm
Thanks for letting us know. Please post again as needed.