httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "K Anand" <>
Subject Re: [users@httpd] How to get the client to download a file ??
Date Mon, 19 Apr 2004 09:41:56 GMT
Actually....I did manage to get them to download the file..I set the content
type as...text/binary or binary/text..etc...One problem came...My server is
linux and my client is the file which got saved on the client
m/c does not hv LF/CR...when it is opened in a text editor, it looks bad.
What i basically want to happen is an ftp in ascii....Any suggestions

Thanx for prompt reply..

----- Original Message ----- 
From: "Boyle Owen" <>
To: <>
Sent: Monday, April 19, 2004 3:01 PM
Subject: RE: [users@httpd] How to get the client to download a file ??

Plain text please...

Actually, every time a user hits a webpage, he downloads a file. That's
what the web is all about :-)

What is important is what the browser does with the file. If it is HTML,
it displays it immediately. If it is something else, then something else
happens; eg, if it's PDF, it starts up Acrobat (if you've got it), if
it's XLS, it starts Excel (if you've got it) etc.

The browser decides what to do based on the mime-type of the file. A
list of mime-types for various file extensions is kept in the file
mime.types in your conf directory.

Having said that, MSIE is known to ignore the mime-type and use the file
extension preferentially. BTW, this violates the HTTP RFC...

If you want to force the browser to pop-up a "Save file" window, you
have to set the mime-type so that it doesn't know what else to do with
it. To set the mime-type for a particular file extension, use the
AddType directive
( If your files
already have a .txt extension then it's a bit tricky - the default for
this is "text/plain" which means that the browser will render it as
text. To force it to save it, either;

- rename the files to something else, eg, myfile.sav and set the
mime-type for these new types of file, eg:

AddType application/octet-stream sav


- override the default txt mime-type, viz:

AddType application/octet-stream txt

The second is a bit drastic since, from then on, any text files will get
saved and not displayed. Of course, you could restrict the scope of this
directive by placing it in a <Directory> or other container... Also,
MSIE will probably ignore it.

Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

-----Original Message-----
From: K Anand []
Sent: Montag, 19. April 2004 10:44
Subject: [users@httpd] How to get the client to download a file ??

I have a small problem...may not be the appropriate place but will give
it a try...

I want my client m/c to download a file from my server...I want to send
the code from my server to the client to force him to download the
file...its a text file...
Basically user will click a link and will be presented with an alert box
wich will tell him that he will have to download the file...Can some one
help ??

Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
e-mail is of a private and personal nature. It is not related to the
exchange or business activities of the SWX Group. Le présent e-mail est
un message privé et personnel, sans rapport avec l'activité boursière du
Groupe SWX.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message