Re: download servlet

I retrieved some code from JavaWorld, so here is another answer:
				res.setContentType("application/x-www-form-urlencoded");
				res.setContentLength(lfile);
				res.addHeader("Content-disposition","attachement; filename="+fic1);

String variable fic1 contains the file name, if you are using servlet 2.1,
you should be using instead
function res.setHeader("Content-disposition","attachement; filename="+fic1);

As for ContentType, Roland Mainz might be right.

Hope this help

j Brax

Received on Wednesday, 24 May 2000 19:02:21 UTC