[Xitami] targeting file downloads

Marc Doigny xitami@lists.xitami.org
Wed, 08 Jun 2005 08:34:13 +0200


At 04:12 8/06/05, you wrote:

> > "Marc Doigny" - said:
> >
> > The only way you could force the browser not trying to display the file is
> > to change the MIME type of the file.
> >
> > Change the association from "video/mpeg" to "application/octet-stream"
> > The visitor will be prompted to "run from current location" or "save".
>
>thank you for your interesting suggestion marc!  by this, i assume that 
>you are talking about editing the individual headers of each of my files 
>in question.  this is not something i've ever experimented with before, 
>but something i plan to look into more deeply in the near future. if it 
>works, it has the potential to fuel my imagination for other projects 
>which are currently on my back-burners :)
>

No, you don't have to edit each file.
The http server adds these headers automatically, using a table located in 
your configuration file (xitami.cfg)

Example of your xitami.cfg file:
[Mime]
     default=*/*                         #   Default MIME type

     #  Text MIME types
     etx=text/x-setext
     htm=text/html
     htp=text/html
     html=text/html
     rtx=text/richtext
     tsv=text/tab-separated-values
     txt=text/plain
     .=text/plain                        #   Files with no extension

     #  Image MIME types
     gif=image/gif
(and so on)


Of course, you could add individual headers to each file (that can be done 
for cgi applications, so you can send the file in "chunked" mode, or gzip 
the file or whatever that request non-standard headers) but it's easier 
with one single configuration file.
Don't modify the xitami.cfg file, but create (or modify) default.cfg


marc

-------------------------------------------------------------------------
--::Mailserver Verfaillie Bauwens::-- contact : postmaster@verfaillie.com
Alle mails gecontroleerd op virussen. Virusdefinities dagelijks aangepast
----------------------- http://www.verfaillie.com -----------------------