logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache creating zip archives from certain file types
Author
filtrete867



Joined: 02 Sep 2009
Posts: 4
Location: California

PostPosted: Wed 02 Sep '09 2:54    Post subject: Apache creating zip archives from certain file types Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Wed 02 Sep '09 10:30    Post subject: Reply with quote

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 Wink
Back to top
filtrete867



Joined: 02 Sep 2009
Posts: 4
Location: California

PostPosted: Thu 03 Sep '09 6:06    Post subject: Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Thu 03 Sep '09 10:10    Post subject: Reply with quote

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

PostPosted: Fri 04 Sep '09 5:11    Post subject: Reply with quote

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

PostPosted: Mon 14 Sep '09 4:15    Post subject: Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Mon 14 Sep '09 10:43    Post subject: Reply with quote

Did you emptied your browser cache? Always the same files? What's in the logs?
Back to top


Reply to topic   Topic: Apache creating zip archives from certain file types View previous topic :: View next topic
Post new topic   Forum Index -> Apache