Reply to Re: File downloading from HTML page

Your name:

Reply:


Posted by Benjamin Niemann on 04/10/06 12:49

MP wrote:

> On my pages I provide links for downloading binary files.
> But for some reason, when a link is clicked, browser downloads and opens
> the file in text format (i.e. "funny" text appears on the screen).
> And if I right-click the link and select the "Save target as...",
> extension ".htm" is incorrectly added on the file name. If I provide the
> correct extension, then it downloads properly.
>
> What is wrong? Example available here:
> http://www.elisanet.fi/matti.puputti/download/files/LaRouteNapoleon_en.htm

Your server serves these files with a Content-Type of text/html. You seem to
have an Apache server, so creating a .htaccess file (if you do not have one
already) with the content

AddType application/octet-stream .kmz .gdb

in your root directory should fix this problem (add any other extension you
need to the list). There might be more appropriate mime-types than
application/octet-stream for your files - I have not looked it up.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация