• Post Reply Bookmark Topic Watch Topic
  • New Topic

What I have missed?  RSS feed

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hola, I know guys, this is very common question, but there is some thing I don't understand.
The question is how to download a PDF file to client's machine and then open it with Acrobat.
I have read something like: response.setContentType("application/pdf");
I write JSP like this:
<html>
<a href="myfile.pdf">Download</a>
</html>
when visiting: localhost:8080/myapp/download.jsp
it downloads the file and open it with Acrobat.
and when visiting : localhost:8080/myapp/myfile.pdf
it downloads the file and open it with Acrobat.
So, what do you mean to set content type.
(Do you mean, when I pressed the link, a servlet should be called to download the file)??
Please, be patient with me !!
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
my understanding of how the PDFs open on a client's machine is down to the mime type settings on that individual machine - for example, I can set on my system to always open a PDF by default or prompt me before doing something or bring up the save dialogue by default.
I don't know about the server settings.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!