|
Posted by Steve West on 10/03/05 18:04
"brucie" <shit@usenetshit.info> wrote in message
news:1tqeb87y1gnyc$.dlg@usenetshit.info...
> In post <news:2K2dnXW3XsUCZt3eRVn-pg@comcast.com>,
> Steve West said:
>
>> 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.
>
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");
Navigation:
[Reply to this message]
|