Apache not sending Content-type: headers. Why?

Apache not sending Content-type: headers. Why?

Post by a.. » Sun, 23 Jun 1996 04:00:00



Hello,everybody.

This is my problem, any help greatly appreciated:

I want to serve files directly through my webserver, and I want them to go
out with a type  specification sucht that the browser will directly
try to save them on disk (rather then looking for helpers apps or somesuch).

I know that application/octet-stream works like this.

So I have added the suffixes I want to handle that way to my mime.types

(E.g: application/octet-stream       bin com exe ovl)

No luck. The browser loads the file directly in the window.

So I defined a new application type (first with AddType, then
editing mime.types) trying to achieve the same effect - to no  
avail.
Finally, I reworked everything through a cgi-bin script that sticks the
correct Content-type: header in front of the file, than shoots it down the
socket and lo! - everyhting is as I expected.

In fact, connecting to port 80 and issuing the appropriate GET statement, I can
see that apache sends me the file *WITHOUT* headers.

This galls me. Where is the catch? Should I change something in the .conf files,
besides AddType?

Apache Version is 1.0.3

Advanced thanks,
        Aleesandro Forghieri
--
---
Alessandro Forghieri            Site administrator Nouvelle srl

Via Giardini 460                Fax:    +39 59 343822

 
 
 

Apache not sending Content-type: headers. Why?

Post by David Efflan » Mon, 24 Jun 1996 04:00:00



>I want to serve files directly through my webserver, and I want them to go
>out with a type  specification sucht that the browser will directly
>try to save them on disk (rather then looking for helpers apps or somesuch).

>I know that application/octet-stream works like this.

>So I have added the suffixes I want to handle that way to my mime.types

>(E.g: application/octet-stream       bin com exe ovl)

>No luck. The browser loads the file directly in the window.

>So I defined a new application type (first with AddType, then
>editing mime.types) trying to achieve the same effect - to no  
>avail.
>Finally, I reworked everything through a cgi-bin script that sticks the
>correct Content-type: header in front of the file, than shoots it down the
>socket and lo! - everyhting is as I expected.

>In fact, connecting to port 80 and issuing the appropriate GET statement, I can
>see that apache sends me the file *WITHOUT* headers.

>This galls me. Where is the catch? Should I change something in the .conf files,
>besides AddType?

>Apache Version is 1.0.3

>Advanced thanks,
>    Aleesandro Forghieri
>--
>---
>Alessandro Forghieri                Site administrator Nouvelle srl

>Via Giardini 460            Fax:    +39 59 343822

The following in .htaccess with Apache 1.0.5 brought up the "save as"
for me and should work as well in srm.conf (without this line it was
sent as text):

AddType application/octet-stream bin exe com ovl

The catch is that UNIX filename extensions are case sensitive.  So
this would NOT work for a file called "TEST.COM".  If you use mixed
case, list upper and lowercase extensions (exe EXE com COM ...).

Playing with your 'mime.types' file is not recommended.

David Efflandt/Elgin, IL USA


 
 
 

1. Apache 1.3.20: ap_send_http_header() sends Content-Type header when response contains no body

The following Apache 1.3.20 code in ap_send_http_header() always
generates a Content-Type message header, even when the response to to
have no body:

    if (r->byterange > 1)
        ap_table_setn(r->headers_out, "Content-Type",
                  ap_pstrcat(r->pool, "multipart", use_range_x(r) ?
"/x-" : "/",
                          "byteranges; boundary=", r->boundary,
NULL));
    else ap_table_setn(r->headers_out, "Content-Type",
make_content_type(r,
        r->content_type));

I would think that a Content-Type message header should not be
included in a response that has no body.  Is this a known problem in
ap_send_http_header()?

Thanks,
Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
CMVC95 WebDAV Development
IBM Corporation
RTP, NC

2. help with cron

3. Capturing Content-Type header on Apache

4. lsof and special characters

5. Setting Header Content-Type on Apache

6. How to locate a hdisk ??

7. Preventing Apache from sending content-type in Linux

8. Connection issues to unix and windows??

9. Content-Type Header Field

10. no "Content-type" sent for CERN proxied FTP URLs?

11. Help: (mail) content-length/type headers not set

12. Apache 1.1.1 sends wrong content type

13. Apache and multipart/mixed Content-type