I've done this before by registering procedures.  This is pretty easy.

For example, you can do:

ns_registerproc POST /my/special/post/url/* myprocname

Then, you can POST to
/my/special/post/url/myfile.exe

you don't have to post of course, you can do a GET to
/my/special/post/url/myfile.exe?var1=val1&var2=val2
(you have to register as type GET in that case).

Doing it as a GET allows the user to bookmark the page.

There are probably more sophisticated ways, but this will work for you.
And it'll work on more or less any browser.

On Tue, 2 Oct 2001, John Divney wrote:

> Hi,
>
> I have a page that POST's back to itself.  I then want to return a .exe
> file to the user, but the Save As dialog box keeps putting the file name in
> there instead of the .exe file name.
>
> I tried Jerry Asher's suggestion from a previous post,
>
> set outputheaders [ns_conn outputheaders]
> ns_set put $outputheaders Content-type application/octet-stream
> ns_set put $outputheaders Content-Disposition \
>         "attachment; filename=\"[file tail foo.bar\"]"
> ns_set put $outputheaders Content-length [file size $filename]
> ns_returnfile 200 [ns_guesstype $filename] "$filename"
>
> but this only seems to be working on NS for me, and not on IE. IE still
> puts the file name in place. IE 5.5
>
> Thanks !!
>
> divney
>

------------------------------------------
Rusty Brooks : http://www.rustybrooks.org/
    Spewing wisdom from every orifice
------------------------------------------

Reply via email to