cgi question

S

Steve West

I am trying to get my client to display the file download/save dialog box
and have the client download a file. The code the server is sending is as
follows:

HTTP/1.1 200 OK
Content-Type: application/x-download
Content-Disposition: attachment

Hello world

any suggestions?
 
B

brucie

I am trying to get my client to display the file download/save dialog box
and have the client download a file. The code the server is sending is as
follows:

just serve the file with the correct mime. let the visitor decide what they
want to do with it. very easy, very simple.
 
D

Disco Octopus

Steve West wrote on 3/10/2005 :
I am trying to get my client to display the file download/save dialog box and
have the client download a file. The code the server is sending is as
follows:

HTTP/1.1 200 OK
Content-Type: application/x-download
Content-Disposition: attachment

Hello world

any suggestions?

what is the file type? is the content-type being set explicitly? if
so, why?
 
S

Steve West

brucie said:
just serve the file with the correct mime. let the visitor decide what
they
want to do with it. very easy, very simple.
But it just displays everything I send as text in a window, it does not ask
what to do with it. Seems like it does not undeerstand the mime.
 
S

Steve West

brucie said:
just serve the file with the correct mime. let the visitor decide what
they
want to do with it. very easy, very simple.
Ok got it to work was missing the html on top. But the file name is the name
of the page. It knows it is a text file. here is what I am sending:
fprintfs (client, "HTTP/1.1 200 OK\n");
fprintfs (client,
"Content-Type: text/plain;\n\tname=\"atadrvr.txt\"\n");
fprintfs (client,
"Content-Transfer-Encoding: 7Bit\n");
fprintfs (client,
"Content-Disposition: attachment;\n\tfilename=\"atadrvr.txt\"\n\n");
fprintfs(client, "Hello world\n");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top