You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ganesh gadi <ga...@yahoo.com> on 2004/07/16 09:47:07 UTC

Control over "File Download" dialog box..

Hi Friends,

i'm very happy to tell u my problems and get answers.

i need a solution how to disable "open" button on 
"File Download" dialog box.i want control on it.
Pls don't say no solution.Bcox i saw that type of
dialogue box...Now i require that feature.
pls let me know the solution asap.

I used the following code to appear "File Download
box"

                httpServletResponse.setContentLength(
(int) f.length());
               
httpServletResponse.setContentType(mimeType);
               
httpServletResponse.setHeader("Content-Disposition","attachment;filename="
+f.getName());

                os =
httpServletResponse.getOutputStream();
                stream = new FileInputStream(f);
                bis = new BufferedInputStream(stream);
                is = new BufferedInputStream(bis);
                int count;
                byte buf[] = new byte[4096];
                while ((count = is.read(buf)) > -1)
                os.write(buf, 0, count);


i'm using 
tomcat 5.0.19
Struts 1.1
IE 6.0
Windows 2000server


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Control over "File Download" dialog box..

Posted by ron1 <ro...@gmx.net>.
you could use a java applet *g*

ganesh gadi wrote:
> Hi Friends,
> 
> i'm very happy to tell u my problems and get answers.
> 
> i need a solution how to disable "open" button on 
> "File Download" dialog box.i want control on it.
> Pls don't say no solution.Bcox i saw that type of
> dialogue box...Now i require that feature.
> pls let me know the solution asap.
> 
> I used the following code to appear "File Download
> box"
> 
>                 httpServletResponse.setContentLength(
> (int) f.length());
>                
> httpServletResponse.setContentType(mimeType);
>                
> httpServletResponse.setHeader("Content-Disposition","attachment;filename="
> +f.getName());
> 
>                 os =
> httpServletResponse.getOutputStream();
>                 stream = new FileInputStream(f);
>                 bis = new BufferedInputStream(stream);
>                 is = new BufferedInputStream(bis);
>                 int count;
>                 byte buf[] = new byte[4096];
>                 while ((count = is.read(buf)) > -1)
>                 os.write(buf, 0, count);
> 
> 
> i'm using 
> tomcat 5.0.19
> Struts 1.1
> IE 6.0
> Windows 2000server
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org