Author |
|
filtrete867
Joined: 02 Sep 2009 Posts: 4 Location: California
|
Posted: Wed 02 Sep '09 2:54 Post subject: Apache creating zip archives from certain file types |
|
|
I am currently running apache 2.0.63 on a windows XP SP3 machine. I have the my documents folder on the machine in sync with the htdocs folder, so I can acess and download my documents over the internet. There are a mix of file types, including those from office. Files such .avi .wav, and .rar can be downloaded easily by just clicking and downloading normally.
However, something strange begins to happen when I try to download a file with the extensions .docx and .pptx. Instead of giving me a file with these extensions, I get a zip archive with a file called [Content_Types].xml and folders with the names word, docProps, and _rels. Why is this happening?
I would prefer to stick with apache because it allows me to have a directory as the home page and not a web page. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 02 Sep '09 10:30 Post subject: |
|
|
That is the nature of that *.*x files from M$. Those documents contains that stuff. The office programs know how to handle that, but apache tries to handle it as plain text.
So you might use in your httpd.conf
Code: |
AddType application/x-msdownload .docx .pptx
|
or
you edit your mime.types in apache conf folder. Search for application/x-msdownload
Both should work, but choose only one |
|
Back to top |
|
filtrete867
Joined: 02 Sep 2009 Posts: 4 Location: California
|
Posted: Thu 03 Sep '09 6:06 Post subject: |
|
|
Thanks, added the code to the Addtype section of the configuration file and the documents are downloading in their native format with no trouble.
I'm always glad to learn something new about Apache I didn't know before
I just have a short question: how does one know what to put for the section marked in red? application/x-msdownload |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 03 Sep '09 10:10 Post subject: |
|
|
filtrete867 wrote: |
I just have a short question: how does one know what to put for the section marked in red? application/x-msdownload |
All file types are defined by IANA[1]
Most of them you'll find in the {apache_root}\conf\mime.types
From the mime.types (just a text file) apache grabs what to do with a file.
Don't be afrait and take a look into that file.
[1] http://www.iana.org/assignments/media-types/ |
|
Back to top |
|
filtrete867
Joined: 02 Sep 2009 Posts: 4 Location: California
|
Posted: Fri 04 Sep '09 5:11 Post subject: |
|
|
Okay, gave that a look. I think I know what to do now if I ever run into that problem in the future. Thanks for your help!!! |
|
Back to top |
|
filtrete867
Joined: 02 Sep 2009 Posts: 4 Location: California
|
Posted: Mon 14 Sep '09 4:15 Post subject: |
|
|
Wierd, the same thing is happening again.
I didn't change anything, yet it randomly went back to what it was doing before. There were no changes I could spot under the AddType section.
I even tried manually adding the file types to the mime file.
No luck
Does anyone know what could be happening now? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 14 Sep '09 10:43 Post subject: |
|
|
Did you emptied your browser cache? Always the same files? What's in the logs? |
|
Back to top |
|