aspose file tools*
The moose likes Servlets and the fly likes Re: downloading from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Re: downloading from a servlet

Adewale Adebusoye
Ranch Hand

Joined: Sep 28, 2005
Posts: 118
Hello:
i included the servlet response headers:

response.setHeader("Content-Type", "text/plain");
response.setHeader("Content-Disposition", "attachment; filename=file.txt"));

the only thing that its not downloading my attached file, rather, its set the filename to null, and its downloading the dynamic html generated by my servlet into a file.

So am i supposed to actually code for the download itself?

Please reply


"Human beings can alter their lives by altering their state of mind" William James
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Adewale,
Please keep your question in one thread.
It gets confusing if it's spread out in multiple threads.

The original is here:
http://www.coderanch.com/t/362023/Servlets/java/downloading-servlet


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Re: downloading from a servlet