Try just println 'Content-Disposition: attachment; filename=file.txt' before ContentType to see if it works for you.
There should be a verb "rhead" for extended headers: 'attachment; filename=file.txt' rhead 'Content-Disposition' See http://www.jsoftware.com/jwiki/CGI/API --- "Sherlock, Ric" <[EMAIL PROTECTED]> wrote: > I've been trying to work out how to use JHP to download files. > Basically I want the user to click on a button/link and be prompted to > save a file to their disk. > As far as I can see the webserver needs the following bits of > information: > * Path of file on server to be downloaded > * Content-Type: <associated MIME type for file> > * Content-Disposition: attachment; filename=<name of file presented to > user> > * Expires: <date/time for a cached version of the file to expire> > > Currently I can point the user to a .jhp file and get them to be > prompted to download a file with the same name as the .jhp file but the > contents of whatever file I write to stdout, but I want to force the > prompt and for it to be a name that I choose. > > To do that I think I need the Content-disposition Response header. Is > this just a question of adding a ContentDisp verb to jhp.ijs analagous > to ContentType? Or is there more involved? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ____________________________________________________________________________________ Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. http://autos.yahoo.com/carfinder/ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
