• Post Reply Bookmark Topic Watch Topic
  • New Topic

open a file in browser  RSS feed

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to open a simple text file in browser but when i run the code it asks me to save the file instead of opening it in browser :



is it correct
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tushar,
Your Content-Disposition is telling the browser to save it as an attachment. If you use the inline content-disposition instead it won't force the save.
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Tushar,
Your Content-Disposition is telling the browser to save it as an attachment. If you use the inline content-disposition instead it won't force the save.


yeah it is showing me what is there in infosupply.java(whose code i have given here) not from display.java which i want .

one more thing : it is showing me entire code of infosupply.java including <HTML><BODY> everything ..
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're going to need to show some more code. What are you writing out after you have the headers?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!