RE: Workaround for IE "streamer bug"?
Ok, now I have tried adding a dummy=.pdf on the url, but it still tells me that it is downloading a file of Filetype = Adobe Acrobat Control for ActiveX and ask me to open og save file. If I then choose open, IE always ask me which application to use, even if it just told me that the filetype was acrobat!?? BTJ On Thu, 2003-10-30 at 19:41, Prabhat Kumar (IT) wrote: > JavaScript? > > -Original Message- > From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 30, 2003 1:36 PM > To: Struts Users Mailing List > Subject: RE: Workaround for IE "streamer bug"? > > > Oki, that sounds like an idea :) > But how do I add a querystring to my url when submitting a form? > > BTJ > > On Thu, 2003-10-30 at 19:05, Prabhat Kumar (IT) wrote: > > I guess this is a known problem with IE. I can't remember but I think we had the > > same problem with IE, and we came across a suggestion somewhere to end the pdf > > requesting URL with a .pdf (something like > > http://servername/xyz/something.do?your-param=xyz&dummy=.pdf) > > > > > > -Original Message- > > From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 30, 2003 12:59 PM > > To: Struts Users Mailing List > > Subject: Re: Workaround for IE "streamer bug"? > > > > > > Well, I have tried both inline and attachment, the only difference is > > that when using attachment I get question of where to save the file on > > all the other browsers instead of just opening (as expected), and IE > > still doesn't work. In fact, using attachment is worse for IE... > > > > Any more suggestions are appreciated... > > > > BTJ > > > > On Thu, 2003-10-30 at 15:19, [EMAIL PROTECTED] wrote: > > > This header currently works for me in a similar case. Try changing your > > > code: > > > > > > response.setHeader("Content-Disposition", "attachment; filename=\"" + > > > filename + "\""); > > > > > > HTH. > > > > > > Atenciosamente, > > > Bruno Arantes de Andrade Bueno > > > Webdeveloper Pleno > > > > > > Fone: +55 (34) 3231-1073 > > > Solution WEB - Soluções Para Internet! > > > www.solutionweb.com.br > > > > > > > > > > > > > > > > > > Bjørn T Johansen <[EMAIL PROTECTED]> > > > 10/30/2003 07:05 AM > > > Please respond to "Struts Users Mailing List" > > > > > > > > > To: Struts Users Mailing List <[EMAIL PROTECTED]> > > > cc: > > > Subject:Workaround for IE "streamer bug"? > > > > > > > > > I have a little problem. I am using the following code to stream pdf > > > files to the browser..: > > > > > > fis = new FileInputStream(filename); > > > byte[] buf = new byte[fis.available()]; > > > > > > response.setHeader("Content-Disposition", "inline;filename=" + > > > filename + ";"); > > > response.setContentType("application/pdf"); > > > response.setHeader("Connection", "keep-alive"); > > > response.setContentLength(buf.length); > > > response.getOutputStream().write(buf,0,fis.read(buf)); > > > response.getOutputStream().flush(); > > > response.getOutputStream().close(); > > > fis.close(); > > > > > > This works ok in all browsers except for IE. When using IE, a dialog box > > > asking the user for which application to open the file in, is always > > > displayed. Why? And is there a workaround for this? > > > > > > > > > Thanks... > > > > > > BTJ > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Workaround for IE "streamer bug"?
As far as I can tell, this is the exact same code that I am using and this doesn't work on my IE (or at work) Are there any settings I can change on IE? BTJ On Thu, 2003-10-30 at 21:16, Nicholson, Robb wrote: > PDF files work OK for us. It displays right in Explorer (with the plug-in > from Adobe). For files that Explorer does not know how to handle, I put in > the content-disposition fix I got from this list, and that worked great. > > Here's the basics of my code... > > (The method "writeContent" is basically a loop that gets a byte stream from > the file and writes that directly to the output stream.) > > >>> > > protected void processRequest(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException > { > FormFile file = (FormFile) request.getAttribute("uploadedFile"); > > // Set servlet response type -- if not set assume text > response.setContentType( (file.getContentType() == null) ? > "text/plain" : > file.getContentType() ); > // Set the content type so download displays filename instead of > request URI > response.setHeader("Content-Disposition","attachment; filename=\"" + > > file.getFileName() + "\""); > > // Get an output stream > ServletOutputStream out = response.getOutputStream(); > > // output the file > writeContent( out, file ); > } > > >>> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Workaround for IE "streamer bug"?
PDF files work OK for us. It displays right in Explorer (with the plug-in from Adobe). For files that Explorer does not know how to handle, I put in the content-disposition fix I got from this list, and that worked great. Here's the basics of my code... (The method "writeContent" is basically a loop that gets a byte stream from the file and writes that directly to the output stream.) >>> protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FormFile file = (FormFile) request.getAttribute("uploadedFile"); // Set servlet response type -- if not set assume text response.setContentType( (file.getContentType() == null) ? "text/plain" : file.getContentType() ); // Set the content type so download displays filename instead of request URI response.setHeader("Content-Disposition","attachment; filename=\"" + file.getFileName() + "\""); // Get an output stream ServletOutputStream out = response.getOutputStream(); // output the file writeContent( out, file ); } >>>
RE: Workaround for IE "streamer bug"?
Ok, I have a small hole at the moment in my Javascript knowledge; I have just started using js :( BTJ On Thu, 2003-10-30 at 19:41, Prabhat Kumar (IT) wrote: > JavaScript? > > -Original Message- > From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 30, 2003 1:36 PM > To: Struts Users Mailing List > Subject: RE: Workaround for IE "streamer bug"? > > > Oki, that sounds like an idea :) > But how do I add a querystring to my url when submitting a form? > > BTJ > > On Thu, 2003-10-30 at 19:05, Prabhat Kumar (IT) wrote: > > I guess this is a known problem with IE. I can't remember but I think we had the > > same problem with IE, and we came across a suggestion somewhere to end the pdf > > requesting URL with a .pdf (something like > > http://servername/xyz/something.do?your-param=xyz&dummy=.pdf) > > > > > > -Original Message- > > From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 30, 2003 12:59 PM > > To: Struts Users Mailing List > > Subject: Re: Workaround for IE "streamer bug"? > > > > > > Well, I have tried both inline and attachment, the only difference is > > that when using attachment I get question of where to save the file on > > all the other browsers instead of just opening (as expected), and IE > > still doesn't work. In fact, using attachment is worse for IE... > > > > Any more suggestions are appreciated... > > > > BTJ > > > > On Thu, 2003-10-30 at 15:19, [EMAIL PROTECTED] wrote: > > > This header currently works for me in a similar case. Try changing your > > > code: > > > > > > response.setHeader("Content-Disposition", "attachment; filename=\"" + > > > filename + "\""); > > > > > > HTH. > > > > > > Atenciosamente, > > > Bruno Arantes de Andrade Bueno > > > Webdeveloper Pleno > > > > > > Fone: +55 (34) 3231-1073 > > > Solution WEB - Soluções Para Internet! > > > www.solutionweb.com.br > > > > > > > > > > > > > > > > > > Bjørn T Johansen <[EMAIL PROTECTED]> > > > 10/30/2003 07:05 AM > > > Please respond to "Struts Users Mailing List" > > > > > > > > > To: Struts Users Mailing List <[EMAIL PROTECTED]> > > > cc: > > > Subject:Workaround for IE "streamer bug"? > > > > > > > > > I have a little problem. I am using the following code to stream pdf > > > files to the browser..: > > > > > > fis = new FileInputStream(filename); > > > byte[] buf = new byte[fis.available()]; > > > > > > response.setHeader("Content-Disposition", "inline;filename=" + > > > filename + ";"); > > > response.setContentType("application/pdf"); > > > response.setHeader("Connection", "keep-alive"); > > > response.setContentLength(buf.length); > > > response.getOutputStream().write(buf,0,fis.read(buf)); > > > response.getOutputStream().flush(); > > > response.getOutputStream().close(); > > > fis.close(); > > > > > > This works ok in all browsers except for IE. When using IE, a dialog box > > > asking the user for which application to open the file in, is always > > > displayed. Why? And is there a workaround for this? > > > > > > > > > Thanks... > > > > > > BTJ > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Workaround for IE "streamer bug"?
JavaScript? -Original Message- From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 1:36 PM To: Struts Users Mailing List Subject: RE: Workaround for IE "streamer bug"? Oki, that sounds like an idea :) But how do I add a querystring to my url when submitting a form? BTJ On Thu, 2003-10-30 at 19:05, Prabhat Kumar (IT) wrote: > I guess this is a known problem with IE. I can't remember but I think we had the > same problem with IE, and we came across a suggestion somewhere to end the pdf > requesting URL with a .pdf (something like > http://servername/xyz/something.do?your-param=xyz&dummy=.pdf) > > > -Original Message- > From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 30, 2003 12:59 PM > To: Struts Users Mailing List > Subject: Re: Workaround for IE "streamer bug"? > > > Well, I have tried both inline and attachment, the only difference is > that when using attachment I get question of where to save the file on > all the other browsers instead of just opening (as expected), and IE > still doesn't work. In fact, using attachment is worse for IE... > > Any more suggestions are appreciated... > > BTJ > > On Thu, 2003-10-30 at 15:19, [EMAIL PROTECTED] wrote: > > This header currently works for me in a similar case. Try changing your > > code: > > > > response.setHeader("Content-Disposition", "attachment; filename=\"" + > > filename + "\""); > > > > HTH. > > > > Atenciosamente, > > Bruno Arantes de Andrade Bueno > > Webdeveloper Pleno > > > > Fone: +55 (34) 3231-1073 > > Solution WEB - Soluções Para Internet! > > www.solutionweb.com.br > > > > > > > > > > > > Bjørn T Johansen <[EMAIL PROTECTED]> > > 10/30/2003 07:05 AM > > Please respond to "Struts Users Mailing List" > > > > > > To: Struts Users Mailing List <[EMAIL PROTECTED]> > > cc: > > Subject:Workaround for IE "streamer bug"? > > > > > > I have a little problem. I am using the following code to stream pdf > > files to the browser..: > > > > fis = new FileInputStream(filename); > > byte[] buf = new byte[fis.available()]; > > > > response.setHeader("Content-Disposition", "inline;filename=" + > > filename + ";"); > > response.setContentType("application/pdf"); > > response.setHeader("Connection", "keep-alive"); > > response.setContentLength(buf.length); > > response.getOutputStream().write(buf,0,fis.read(buf)); > > response.getOutputStream().flush(); > > response.getOutputStream().close(); > > fis.close(); > > > > This works ok in all browsers except for IE. When using IE, a dialog box > > asking the user for which application to open the file in, is always > > displayed. Why? And is there a workaround for this? > > > > > > Thanks... > > > > BTJ > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Workaround for IE "streamer bug"?
Oki, that sounds like an idea :) But how do I add a querystring to my url when submitting a form? BTJ On Thu, 2003-10-30 at 19:05, Prabhat Kumar (IT) wrote: > I guess this is a known problem with IE. I can't remember but I think we had the > same problem with IE, and we came across a suggestion somewhere to end the pdf > requesting URL with a .pdf (something like > http://servername/xyz/something.do?your-param=xyz&dummy=.pdf) > > > -Original Message- > From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 30, 2003 12:59 PM > To: Struts Users Mailing List > Subject: Re: Workaround for IE "streamer bug"? > > > Well, I have tried both inline and attachment, the only difference is > that when using attachment I get question of where to save the file on > all the other browsers instead of just opening (as expected), and IE > still doesn't work. In fact, using attachment is worse for IE... > > Any more suggestions are appreciated... > > BTJ > > On Thu, 2003-10-30 at 15:19, [EMAIL PROTECTED] wrote: > > This header currently works for me in a similar case. Try changing your > > code: > > > > response.setHeader("Content-Disposition", "attachment; filename=\"" + > > filename + "\""); > > > > HTH. > > > > Atenciosamente, > > Bruno Arantes de Andrade Bueno > > Webdeveloper Pleno > > > > Fone: +55 (34) 3231-1073 > > Solution WEB - Soluções Para Internet! > > www.solutionweb.com.br > > > > > > > > > > > > Bjørn T Johansen <[EMAIL PROTECTED]> > > 10/30/2003 07:05 AM > > Please respond to "Struts Users Mailing List" > > > > > > To: Struts Users Mailing List <[EMAIL PROTECTED]> > > cc: > > Subject:Workaround for IE "streamer bug"? > > > > > > I have a little problem. I am using the following code to stream pdf > > files to the browser..: > > > > fis = new FileInputStream(filename); > > byte[] buf = new byte[fis.available()]; > > > > response.setHeader("Content-Disposition", "inline;filename=" + > > filename + ";"); > > response.setContentType("application/pdf"); > > response.setHeader("Connection", "keep-alive"); > > response.setContentLength(buf.length); > > response.getOutputStream().write(buf,0,fis.read(buf)); > > response.getOutputStream().flush(); > > response.getOutputStream().close(); > > fis.close(); > > > > This works ok in all browsers except for IE. When using IE, a dialog box > > asking the user for which application to open the file in, is always > > displayed. Why? And is there a workaround for this? > > > > > > Thanks... > > > > BTJ > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Workaround for IE "streamer bug"?
I guess this is a known problem with IE. I can't remember but I think we had the same problem with IE, and we came across a suggestion somewhere to end the pdf requesting URL with a .pdf (something like http://servername/xyz/something.do?your-param=xyz&dummy=.pdf) -Original Message- From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 12:59 PM To: Struts Users Mailing List Subject: Re: Workaround for IE "streamer bug"? Well, I have tried both inline and attachment, the only difference is that when using attachment I get question of where to save the file on all the other browsers instead of just opening (as expected), and IE still doesn't work. In fact, using attachment is worse for IE... Any more suggestions are appreciated... BTJ On Thu, 2003-10-30 at 15:19, [EMAIL PROTECTED] wrote: > This header currently works for me in a similar case. Try changing your > code: > > response.setHeader("Content-Disposition", "attachment; filename=\"" + > filename + "\""); > > HTH. > > Atenciosamente, > Bruno Arantes de Andrade Bueno > Webdeveloper Pleno > > Fone: +55 (34) 3231-1073 > Solution WEB - Soluções Para Internet! > www.solutionweb.com.br > > > > > > Bjørn T Johansen <[EMAIL PROTECTED]> > 10/30/2003 07:05 AM > Please respond to "Struts Users Mailing List" > > > To: Struts Users Mailing List <[EMAIL PROTECTED]> > cc: > Subject:Workaround for IE "streamer bug"? > > > I have a little problem. I am using the following code to stream pdf > files to the browser..: > > fis = new FileInputStream(filename); > byte[] buf = new byte[fis.available()]; > > response.setHeader("Content-Disposition", "inline;filename=" + > filename + ";"); > response.setContentType("application/pdf"); > response.setHeader("Connection", "keep-alive"); > response.setContentLength(buf.length); > response.getOutputStream().write(buf,0,fis.read(buf)); > response.getOutputStream().flush(); > response.getOutputStream().close(); > fis.close(); > > This works ok in all browsers except for IE. When using IE, a dialog box > asking the user for which application to open the file in, is always > displayed. Why? And is there a workaround for this? > > > Thanks... > > BTJ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Workaround for IE "streamer bug"?
Well, I have tried both inline and attachment, the only difference is that when using attachment I get question of where to save the file on all the other browsers instead of just opening (as expected), and IE still doesn't work. In fact, using attachment is worse for IE... Any more suggestions are appreciated... BTJ On Thu, 2003-10-30 at 15:19, [EMAIL PROTECTED] wrote: > This header currently works for me in a similar case. Try changing your > code: > > response.setHeader("Content-Disposition", "attachment; filename=\"" + > filename + "\""); > > HTH. > > Atenciosamente, > Bruno Arantes de Andrade Bueno > Webdeveloper Pleno > > Fone: +55 (34) 3231-1073 > Solution WEB - Soluções Para Internet! > www.solutionweb.com.br > > > > > > Bjørn T Johansen <[EMAIL PROTECTED]> > 10/30/2003 07:05 AM > Please respond to "Struts Users Mailing List" > > > To: Struts Users Mailing List <[EMAIL PROTECTED]> > cc: > Subject:Workaround for IE "streamer bug"? > > > I have a little problem. I am using the following code to stream pdf > files to the browser..: > > fis = new FileInputStream(filename); > byte[] buf = new byte[fis.available()]; > > response.setHeader("Content-Disposition", "inline;filename=" + > filename + ";"); > response.setContentType("application/pdf"); > response.setHeader("Connection", "keep-alive"); > response.setContentLength(buf.length); > response.getOutputStream().write(buf,0,fis.read(buf)); > response.getOutputStream().flush(); > response.getOutputStream().close(); > fis.close(); > > This works ok in all browsers except for IE. When using IE, a dialog box > asking the user for which application to open the file in, is always > displayed. Why? And is there a workaround for this? > > > Thanks... > > BTJ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Workaround for IE "streamer bug"?
This header currently works for me in a similar case. Try changing your code: response.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\""); HTH. Atenciosamente, Bruno Arantes de Andrade Bueno Webdeveloper Pleno Fone: +55 (34) 3231-1073 Solution WEB - Soluções Para Internet! www.solutionweb.com.br Bjørn T Johansen <[EMAIL PROTECTED]> 10/30/2003 07:05 AM Please respond to "Struts Users Mailing List" To: Struts Users Mailing List <[EMAIL PROTECTED]> cc: Subject:Workaround for IE "streamer bug"? I have a little problem. I am using the following code to stream pdf files to the browser..: fis = new FileInputStream(filename); byte[] buf = new byte[fis.available()]; response.setHeader("Content-Disposition", "inline;filename=" + filename + ";"); response.setContentType("application/pdf"); response.setHeader("Connection", "keep-alive"); response.setContentLength(buf.length); response.getOutputStream().write(buf,0,fis.read(buf)); response.getOutputStream().flush(); response.getOutputStream().close(); fis.close(); This works ok in all browsers except for IE. When using IE, a dialog box asking the user for which application to open the file in, is always displayed. Why? And is there a workaround for this? Thanks... BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]