Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Cannot make file download work

Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is using RichFaces 3.3.1

I have a small app that searches for various files and returns results. The user can either download the files they shorts, or the results as a CSV. I simply cannot get the file download to work correctly in Internet Explorer. I have tried various things and get different problems.

Server Code
This is intended to provide the results as a correctly formatted CSV upon receipt of a user request.
If I have a command button like thisor this
The CSV appears in the browser (FireFox or Internet Explorer) itself as plain text. The CSV looks correct, but I do not get prompted for file download like I would expect.

If I have a command button (or command link) like this

Then I get the file download prompt, but whilst FireFox works perfectly, the download progress bar in Internet Explorer appears briefly then just vanishes and there is no download.

Does anyone know what I could be doing wrong - I am sure it is something simple.

Thanks in advance.
Jason Irwin
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going to sit in a corner and have a cry I think.

It turns out that the fault is with my copy of IE, and not the code. Specifically it appears to be the "IE7Pro" add-on that I totally forgot I had on the client that is causing the problem. No idea what it is doing, but getting rid of it cured the problem.

Is there some other, more "proper" way I should be doing the file download? A stand-alone servlet contacted via URI or something? Would that have any problems in getting information from the Faces framework? It's going to need login details etc. Be interested in hearing any opinions.

So, moral of the story, make sure you know that your client environment is clean!

Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic