PEGASUS84 wrote:
my action  is this:
public class FileDownload extends ActionSupport {
InputStream inputStream;


   public void setInputStream(InputStream s){inputStream=s;}
   public InputStream getInputStream(){return inputStream;}

   public String execute(){
   return "sendFile";
   }
}
and in Struts.xml i've this:

<action name="fileDownload" class="action.FileDownload" >
               <result name="sendFile" type="stream">
               ${contentType}
               </result>
       </action>

i wish to download a file

So you'll need a "contentType" action property. If you look at Pawel's email you'll see where he opens a file and uses it as the input stream:

String pathname = appPath + "/WEB-INF/user/fotki/"
                  + motionFile.getMotionFileName();
return new FileInputStream(new File(pathname));

There's also a complete example in the showcase application.

Dave

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

Reply via email to