• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

urgently needed help

 
sreedhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we are developing a job site using servlets.In that when employer clicks on the resume of particular jobseeker (it is a ms word doc file) in Netscape browser, I want to display a pop up window with the options open or save . when the user select open then the document has to displayed.If he select save then file dialog box has to be displayed and this document is saved in the target file mentioned by the client. I am unable to do this.
If any one has solution or code please provide. It is urgently required.
Thanks in advance,
sreedhar garimella,
sreedhar_gari@hotmail.com .
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is usually just a browser configuration. What does happen on your system when the user clicks on a link to a Word document?
 
Milind Kulkarni
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sreedhar,
You could use HTTP response header named content-disposition to
allow the servlet to specify information about the file's presentation. Using that header, you can indicate that the content should be opened separately (not actually in the browser) and that it should not be displayed automatically but rather upon some further action by the user. You can also suggest the filename to be used if the content is to be saved to a file. That filename would be the name of the file that appears in the Save As dialog box.
In the servlet, you want to set that header as follows:
res.setHeader("Content-disposition",
"attachment; filename=" +
"Example.pdf" );

Hope this helps !!
Regards,
Milind
 
Aaron Robinson
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the article on JavaWorld that covers this exact requirement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic