469,592 Members | 1,801 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

How to avoid file download dialog box while opening the attachment using java servlet

In my user screen I have view link, if I click this link it will go to servlet and open one word document. It is opening properly, but while opening the attachment it generate one dialog box like file Open, Save or Cancel button, if I click open after that it is opening the document. But my query is it should not display this dialog box, once I click the link it should open the document automatically using HttpServletResponse. Can any one help me to avoid the pop up window?

Sample Code

response.setContentType("application/msword");

response.setHeader("Content-disposition","attachment; filename=testing.doc");

If I use inline then the file name is not coming, full URL coming as a header.

Please help me.

Regards
Aarthi
May 1 '07 #1
0 3562

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by peetm | last post: by
reply views Thread by Dean A. Hoover | last post: by
2 posts views Thread by Sleepy | last post: by
4 posts views Thread by Vishal | last post: by
4 posts views Thread by Nathan Sokalski | last post: by
4 posts views Thread by Jonny | last post: by
4 posts views Thread by L. Scott M. | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.