This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
    Bookmark Topic Watch Topic
  • New Topic

Re: downloading from a servlet

 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic