|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Inline downloading of file with Struts 1.2Hello,
I'm coding a Struts 1.2 action to download file available on the server. I need to send back the file as inline so that the browser will process it within the same window. the relevant code is : response.setContentType("application/java-archive"); response.setHeader("Content-disposition", "inline; filename=file.jar"); However, when I try accessing the URL the Apache http client give the following response: HTTP/1.1 200 OK Response content length: -1 Content-Type = application/java-archive With length -1. Any suggestion on how could I do this? It's essential that the jar file is processed within the browser window, as the file incorporates an XUL (XML file) that needs automatically be processed by Firefox. Many thanks, Dan |
|
|
Re: Inline downloading of file with Struts 1.2Hello,
I was wondering if any of the more experience people have suggestion about this issue. The problem is that Firefox 3.5 - differently from Firefox 2 - does not process automatically XUL files zipped in jar files, if the jar file is requested to be downloaded as attachment rather than inline within the browser window. Any suggestion/help, much appreciated! Dan On Fri, Oct 30, 2009 at 7:25 PM, Daniele Development-ML < daniele.dml@...> wrote: > Hello, > > I'm coding a Struts 1.2 action to download file available on the server. I > need to send back the file as inline so that the browser will process it > within the same window. > > the relevant code is : > > response.setContentType("application/java-archive"); > response.setHeader("Content-disposition", "inline; filename=file.jar"); > > However, when I try accessing the URL the Apache http client give the > following response: > > HTTP/1.1 200 OK > Response content length: -1 > Content-Type = application/java-archive > > With length -1. > > Any suggestion on how could I do this? It's essential that the jar file is > processed within the browser window, as the file incorporates an XUL (XML > file) that needs automatically be processed by Firefox. > > Many thanks, > > Dan > |
|
|
RE: Inline downloading of file with Struts 1.2>-----Original Message----- >From: Daniele Development-ML [mailto:daniele.dml@...] >Sent: Tuesday, November 03, 2009 8:58 AM >To: Struts Users Mailing List >Subject: Re: Inline downloading of file with Struts 1.2 > >Hello, > >I was wondering if any of the more experience people have suggestion >about >this issue. The problem is that Firefox 3.5 - differently from Firefox 2 >- >does not process automatically XUL files zipped in jar files, if the jar >file is requested to be downloaded as attachment rather than inline >within >the browser window. > >Any suggestion/help, much appreciated! > >Dan > >On Fri, Oct 30, 2009 at 7:25 PM, Daniele Development-ML < >daniele.dml@...> wrote: > >> Hello, >> >> I'm coding a Struts 1.2 action to download file available on the >server. I >> need to send back the file as inline so that the browser will process >it >> within the same window. >> >> the relevant code is : >> >> response.setContentType("application/java-archive"); >> response.setHeader("Content-disposition", "inline; >filename=file.jar"); >> >> However, when I try accessing the URL the Apache http client give the >> following response: >> >> HTTP/1.1 200 OK >> Response content length: -1 >> Content-Type = application/java-archive >> >> With length -1. >> >> Any suggestion on how could I do this? It's essential that the jar >file is >> processed within the browser window, as the file incorporates an XUL >(XML >> file) that needs automatically be processed by Firefox. >> >> Many thanks, >> >> Dan >> Here are 2 examples, the first displays inline, and the second forces a download, both using the same action. <action name="personImage" class="StreamImageAction"> <result name="success" type="stream"> <param name="contentType">image/jpeg</param> <param name="inputName">inputStream</param> <param name="contentDisposition">filename="image.jpg"</param> <param name="bufferSize">1024</param> </result> </action> <action name="saveImage" class="StreamImageAction"> <result name="success" type="stream"> <param name="contentType">image/jpeg</param> <param name="inputName">inputStream</param> <param name="contentDisposition">attachment; filename="image.jpg"</param> <param name="bufferSize">1024</param> </result> </action> --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Inline downloading of file with Struts 1.2Problem solved. The mistake was using part of the old content disposition
tag: response.setHeader("Content-disposition", "inline; filename=file.jar"); instead of specifying only inline, like this: response.setHeader("Content-disposition", "inline"); Thanks, Dan On Tue, Nov 3, 2009 at 2:25 PM, Mike Baranski < list-subscriptions@...> wrote: > > > >-----Original Message----- > >From: Daniele Development-ML [mailto:daniele.dml@...] > >Sent: Tuesday, November 03, 2009 8:58 AM > >To: Struts Users Mailing List > >Subject: Re: Inline downloading of file with Struts 1.2 > > > >Hello, > > > >I was wondering if any of the more experience people have suggestion > >about > >this issue. The problem is that Firefox 3.5 - differently from Firefox 2 > >- > >does not process automatically XUL files zipped in jar files, if the jar > >file is requested to be downloaded as attachment rather than inline > >within > >the browser window. > > > >Any suggestion/help, much appreciated! > > > >Dan > > > >On Fri, Oct 30, 2009 at 7:25 PM, Daniele Development-ML < > >daniele.dml@...> wrote: > > > >> Hello, > >> > >> I'm coding a Struts 1.2 action to download file available on the > >server. I > >> need to send back the file as inline so that the browser will process > >it > >> within the same window. > >> > >> the relevant code is : > >> > >> response.setContentType("application/java-archive"); > >> response.setHeader("Content-disposition", "inline; > >filename=file.jar"); > >> > >> However, when I try accessing the URL the Apache http client give the > >> following response: > >> > >> HTTP/1.1 200 OK > >> Response content length: -1 > >> Content-Type = application/java-archive > >> > >> With length -1. > >> > >> Any suggestion on how could I do this? It's essential that the jar > >file is > >> processed within the browser window, as the file incorporates an XUL > >(XML > >> file) that needs automatically be processed by Firefox. > >> > >> Many thanks, > >> > >> Dan > >> > > Here are 2 examples, the first displays inline, and the second forces a > download, both using the same action. > > <action name="personImage" class="StreamImageAction"> > <result name="success" type="stream"> > <param name="contentType">image/jpeg</param> > <param name="inputName">inputStream</param> > <param > name="contentDisposition">filename="image.jpg"</param> > <param name="bufferSize">1024</param> > </result> > </action> > > <action name="saveImage" class="StreamImageAction"> > <result name="success" type="stream"> > <param name="contentType">image/jpeg</param> > <param name="inputName">inputStream</param> > <param name="contentDisposition">attachment; > filename="image.jpg"</param> > <param name="bufferSize">1024</param> > </result> > </action> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@... > For additional commands, e-mail: user-help@... > > |
| Free embeddable forum powered by Nabble | Forum Help |