What do you mean by "dialog"?  Do you want to download this file to
display it?  Or do you want to download it to keep?  The return null
for the ActionForward is used to display resources and is called after
the response is committed.  The call is part and parcel of the content
of the response.

Jack


On Tue, 23 Nov 2004 16:47:21 +0100, moralesdefrķas <moralesdefrķas> wrote:
> Hi”
> 
> I already know that this problem have been resolved before, but i can't find 
> the solution searching in this post. (Or solutions founded don't help me).
> 
> I have an action that generates pdf files, and zip them. And i want to 
> download it... but i have two problems:
> 
> --> File that appears in dialog is "Action'sNameA.do", no "MyFile.zip"....
> 
> code is like this
> -------------------------------------------------
> 
>                         if (gz.exists()) {
> 
>                                 response.setContentType("application/zip");
>                                 
> response.setHeader("Content-Disposition","attachment; fichero=\"" + 
> nombreBaseFichero + "\";");
>                                 response.setContentLength((int)gz.length());
> 
>                                 ServletOutputStream sos;
>                                 sos = response.getOutputStream();
> 
>                                 FileInputStream stream = new 
> FileInputStream(gz);
>                                 BufferedInputStream  bis = new 
> BufferedInputStream(stream);
>                                 InputStream is = new BufferedInputStream(bis);
>                                 int count;
>                                 byte buf[] = new byte[4096];
>                                 while ((count = is.read(buf)) > -1)
>                                         sos.write(buf, 0, count);
> 
>                                 is.close();
>                                 sos.close();
>                         }
> -------------------------------------------------
> 
> ---> Dialog appears two times, and next any action i take, download's dialog 
> appears. I read that action must return "null" but iit doesn't work.
> 
> Can you help me, please???
> 
> Thanks in advance.
> 
> 


-- 


"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to