[10392] in www-talk@info.cern.ch

home help back first fref pref prev next nref lref last post

Re: HTTP header suggestion/request

daemon@ATHENA.MIT.EDU (Maurizio Codogno)
Fri Nov 8 06:25:50 1996

Date: Fri, 8 Nov 1996 12:25:31 +0100
From: mau@beatles.cselt.stet.it (Maurizio Codogno)
To: mnaumann@eso.org
Cc: www-talk@w3.org
Resent-From: www-talk@w3.org


% > That form has one ACTION.  On that form you can check a box to download
% > code.tar, code.tar.Z, or code.tar.gz.  The user picks the option they want
% > then submits the form to the CGI.  Since the form has one ACTION only one
% > CGI can be called, and since there are 3 possibly names putting an extension
% > on the ACTION will be wrong for any 2 of them.
% 
% you could use the Content-Disposition: header field
% (beware: it's not in the http-v11-spec07 but borrowed
% from MIME) ie send
% 
%   Content-Type:        application/octet-stream
%   Content-Disposition: attachment; filename=code.tar
% 
% from your ACTION script.

I am surely stupid, but I wrote a short CGI script saying
-----
#!/bin/sh
 
echo Content-type: application/octet-stream
echo Content-Disposition: attachment; filename="pippo.txt"
echo
 
echo This is a test - I hope
echo
-----
and tried to access it at 
http://beatles.cselt.stet.it/cgi-bin/test-att 

Answer is 
-----
(B) 12:20 mau 394> telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /cgi-bin/test-att HTTP/1.0
 
HTTP/1.0 200 Document follows
Date: Fri, 08 Nov 1996 11:23:03 GMT
Server: NCSA/1.5.2
Content-type: application/octet-stream
Content-Disposition: attachment
 
This is a test - I hope
-----
and as you can see the filename is completely lost (actually, netscape
asks where to save "test-att". Is it fault of NCSA httpd ?

.mau.


home help back first fref pref prev next nref lref last post