download dialogue by attachment in response.setHeader("

I am using following statment in downloading a file from application server.

Some times 2 windows open one after other.

When clicking thebutton, user is presented with dialog box then when user clicks "open" user isagain presented with dialog box and needs to click open again..

What i need to do ,to restrict the window second time. ?

--

response.setHeader("Content-Disposition","attachment;filename=\"" + strFileName + "\"");// set header information

[511 byte] By [raghuveer_vellankia] at [2007-10-3 0:19:29]
# 1
may be you are dupliacying the code Twice Check the code once.I think there is no such condition to retrict the window for only onceYou need to check your coderegardsChandu
Sambarapua at 2007-7-14 17:10:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

This is happening for CSV file only.

response.setContentType("text/csv"); // set MIME type for csv file

response.setHeader("Content-Disposition", "attachment; filename=\"" + strExportFileName + "\"");

On click of download button Open/Save dialogue window is opened.If we click Open Button again dialogue window is opened with Checknox is checked and enabled.

.For excel file on click of Open for first file opens.But the above problems occur for CSV file only.

raghuveer_vellankia at 2007-7-14 17:10:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi,Even I am facing the same problem, In case of windows 2000, the open file dialog opens twice. But for the same works fine with windows xp.Let me know if any work around exists for the sameThanks,Shibu
Shibua at 2007-7-14 17:10:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

umm might not be related to OS. I am facing the problem in XP too. I have two servlets and one of them is giving this problem where as other one is perfectly fine. could not find anything in my code which could trigger two submits. infact the SAVE button is working only once. PS me if anyone got a solution ...

Message was edited by:

nickabcd

nickabcda at 2007-7-14 17:10:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Even I am facing the same problem. I see the Download Dialog twice while downloading a .txt or .sh files where as .doc and .pdf files looks fine. This happens only on a win2000 machine Xp seems to be good. Let me know if anybody finds a solution.
josh_ramesha at 2007-7-14 17:10:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Wanted to share this link just in case someone needs a workaround by doing system settings. Please follow the link below

http://www.rpmsoftware.com/wiki/index.php/Download_asks_twice

Even though this works for me I really cannot go for this solution as it invovlves system settings.(I cant ask each and every customer to do a system setting.)I am looking towards for a code fix.

josh_ramesha at 2007-7-14 17:10:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...