Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rendering ByteArrayOutputStream in IE through struts.

Abhiram Gowda
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a peculiar problem while rendering binary files in IE through servlets. Actually I read binary files stored as BLOB from the database (DB2) and render them on the internet explorer using a servlet (struts action class). This is the code i use to render the files;

byteArrayOutputStream = //get byteArrayOutputStream from the database.
ServletOutputStream sos = null;
StringBuffer sbContentDispValue = new StringBuffer();

sbContentDispValue.append("; filename=");

response.setHeader(" Content-disposition",sbContentDispValue.toString());
response.setHeader("Cache-Control", "max-age=30");
sos = response.getOutputStream();

When I run my application on windows (using WSAD 6.0), I get a open/save/cancel dialog box. But the moment I run the application from a unix system which has Websphere 6.0, I only get a save/cancel dialog box. Besides, the filename displayed in the dialog box is improper. I tried using the content type as "application/unknown", "application/x-download". But nothing seems to be working. Has anyone of you faced a similiar problem before? Any help would be most welcome.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic