Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

.csv files are opend in the same browser withour displaying the download dialog box.

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In our web based application we are using windows XP SP-2 and IE 6.0
When the user clicks on the link related to CSV File generation, the generated file is directly displayed in the browser, from where its link was clicked, with prompting the user with the download dialog box as to whether he wish to "Open" the file or "Save" it.

The function which takes care of the download is as below :-

if (strFileType.equals(LCConstants.ACTION_XML))
{//if it is XML
out = response.getOutputStream();
{//if it is CSV
out = response.getOutputStream();
ByteArrayOutputStream byteStream=new ByteArrayOutputStream();
}//end of download()

The above code works fine for windows 2000.
If in the above code "inline" is changed to "attachment" then, it works fine in windowz XP but in window 2000 it pops up the download dialog box twice.

While I know about the "Confirm open after download" and "Browse in same
window" options that I can set for the file types,
is there any way to force IE to always ask to Open/Save a file, regardless of the extension?

can abody plz share their knowlegde with me.
Thank you.
author & internet detective
Posts: 41944
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Notice that the xml one is set to "attachment" and the csv one is set to "inline." This is what is causing one to be downloaded (like an attachment) and one to be displayed in the browser (inline.) Switching the cvs one to attachment will give you the desired behavior.
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic