• Post Reply Bookmark Topic Watch Topic
  • New Topic

Content Type

 
Suresh Babu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
In my application there are 18 text files which i need to show the user in notepad. There are links for all the textfiles in my jsp.
I am setting the content type as

response.setContentType("application/octet-stream");
response.setHeader("content-disposition","attachment;filename="+"\""+fileName+"\"");
When i click the first link, it prompts me to save or open and i am able to save it. Clicking the subsequent links shows me javasript error as Access is denied.
If i remove the frames from my application, i am able to click all the links and save them.
I am finding problems only with frames. Can you let me know the reason for this and how to overcome this problem....
Thanks
Babu
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Babu Babu",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
We tend to manage questions of this sort on the Servlets forum, since it is not Java specific. I'll get the question moved there for you, you'll have a better chance of a solution.
Thanks.
Dave
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!