Okay, then, try declaring a forward in your struts-config that points to the file in question, then return this ActionForward from your action. That should have the same effect as would a link AFAIK.
peace, Joe > -----Original Message----- > From: LFung [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 27, 2002 6:43 PM > To: Struts Users Mailing List > Subject: Re: send file from action > > > Joe but I don't want to show the user a link to the document. > > I have searched for a code or exmaple, but nothing. > > thanks > > ----- Original Message ----- > From: "Joe Barefoot" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Friday, September 27, 2002 3:36 PM > Subject: RE: send file from action > > > I believe you are over-thinking this a bit...this has nothing > to do with > struts. > > You should be able to put a link directly to the word doc > file. When the > user clicks on it, they should get a save/download dialog. > If your .doc > mime type is set in your web server, the browser will attempt > to open the > file instead in the browser window. Turn the mime type > association OFF in > your web server to get the save/open dialog. > > hunt around, I'm sure you'll find an example. > > peace, > Joe > > > > -----Original Message----- > > From: LFung [mailto:[EMAIL PROTECTED]] > > Sent: Friday, September 27, 2002 6:20 PM > > To: Struts Users Mailing List > > Subject: Re: send file from action > > > > > > I have this code: > > > > <% > > /* HKEY_CLASSES_ROOT\MIME\Database\Content Type */ > > > > response.setContentType("application/msword"); > > response.setHeader("Content-Disposition", "attachment; > > filename=\"" + > > "prorroga.doc;" + "\""); > > ServletOutputStream output = response.getOutputStream(); > > > > byte[] inBytes = new byte[128]; > > FileInputStream fileInputstream = new > > FileInputStream("C:\\resin-2.1.4\\webapps\\intrama\\prorroga.doc"); > > int len = fileInputstream.read(inBytes); > > while(len != -1) // Check for EOF > > { > > output.write(inBytes, 0, len); > > len = fileInputstream.read(inBytes); > > } > > %> > > > > but the word file is ouputed in the page (to bad) > > > > I am using tiles to conform the page. but I think that this > is not the > > problem. > > > > > > ----- Original Message ----- > > From: "LFung" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > Sent: Friday, September 27, 2002 6:15 PM > > Subject: Re: send file from action > > > > > > > I mean download, I reach to open dialog (open / save) > > > > > > ----- Original Message ----- > > > From: "Joe Barefoot" <[EMAIL PROTECTED]> > > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > > Sent: Friday, September 27, 2002 3:08 PM > > > Subject: RE: send file from action > > > > > > > > > What do you mean by "send"? A download? via email? > > > > > > > -----Original Message----- > > > > From: LFung [mailto:[EMAIL PROTECTED]] > > > > Sent: Friday, September 27, 2002 3:19 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: send file from action > > > > > > > > > > > > Hi: > > > > > > > > how can I implement an action to send a use a file, for > > > > example a .doc file. > > > > > > > > thanks in advance. > > > > > > > > LFung. > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

