RE: Downloading file rendered in JSP

2008-04-08 Thread Brad A Cupit
Mailing List Subject: RE: Downloading file rendered in JSP Thanks for that. I actually just needed to implement the ServletResponseAware interface to access the servlet response properly. Trying to set those in the JSP (through a scriplet) didn't work, but indeed doing it in the action is

RE: Downloading file rendered in JSP

2008-04-08 Thread David Loup
ailto:[EMAIL PROTECTED] Sent: 08 April 2008 14:25 To: Struts Users Mailing List Subject: RE: Downloading file rendered in JSP To set the download file name, in addition to the "text/csv" mime type (which you already have set), write the following java code in your Action or (if necessary)

RE: Downloading file rendered in JSP

2008-04-08 Thread Brad A Cupit
IS -Original Message- From: David Loup [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 7:42 AM To: user@struts.apache.org Subject: Downloading file rendered in JSP Hi, I'm trying to make one of my pages downloadable as a CSV file. Currently my XML is configured like this:

Downloading file rendered in JSP

2008-04-08 Thread David Loup
Hi, I'm trying to make one of my pages downloadable as a CSV file. Currently my XML is configured like this: /pages/download.jsp And /pages/download.jsp renders the list as a CSV. I have changed the content type in the CSV: <%@ page contentType="text/csv" %>

Re: Downloading file

2006-11-03 Thread Balwinder
Mike Baroukh wrote: You must use content-disposition header : response.setHeader("Content-Disposition", "attachment; filename=\""+myfilename+"\""); You can also add a mime type with something like String mimeType = getServletContext().getMimeType(myfilename); response.setHeader("Content-Ty

Re: Downloading file

2006-11-03 Thread Puneet Lakhina
On 11/3/06, Balwinder <[EMAIL PROTECTED]> wrote: Hi All, I am developing an application in struts in which I needed to download a file from a server. When iam clicking on download button, file lose its extension and it with the action ie .do and does not open with the associated application.

Re: Downloading file

2006-11-03 Thread Niall Pemberton
On 11/3/06, Balwinder <[EMAIL PROTECTED]> wrote: Hi All, I am developing an application in struts in which I needed to download a file from a server. When iam clicking on download button, file lose its extension and it with the action ie .do and does not open with the associated application. A

Re: Downloading file

2006-11-03 Thread Mike Baroukh
You must use content-disposition header : response.setHeader("Content-Disposition", "attachment; filename=\""+myfilename+"\""); You can also add a mime type with something like String mimeType = getServletContext().getMimeType(myfilename); response.setHeader("Content-Type", mimeType==null?"

Downloading file

2006-11-03 Thread Balwinder
Hi All, I am developing an application in struts in which I needed to download a file from a server. When iam clicking on download button, file lose its extension and it with the action ie .do and does not open with the associated application. Any help is highly appreciated. Thanks in adva

Re: Problem downloading file

2004-11-23 Thread Struts User
Here is a good article related to the problem: http://www.javaworld.com/javatips/jw-javatip94_p.html Lee On Tue, 23 Nov 2004 18:38:30 -0500, Erik Weber <[EMAIL PROTECTED]> wrote: > > > Dakota Jack wrote: > > >Weber, you're the best. Thanks a million. > > > >Jack > > > > > > You're quite we

Re: Problem downloading file

2004-11-23 Thread Erik Weber
Dakota Jack wrote: Weber, you're the best. Thanks a million. Jack You're quite welcome. P.S. Would you like a gmail invite? Why, thank you. But, I already have a gmail account. Unfortunately, my main email address long has been posted all over the Web (I didn't know any better), so wh

Re: Problem downloading file

2004-11-23 Thread Dakota Jack
Weber, you're the best. Thanks a million. Jack P.S. Would you like a gmail invite? On Tue, 23 Nov 2004 13:31:54 -0500, Erik Weber <[EMAIL PROTECTED]> wrote: > > > Morales de Frías wrote: > > >Hi¡ > > > >I already know that this problem have been resolved before, but i can't find > >the

Re: Problem downloading file

2004-11-23 Thread Erik Weber
Morales de Frí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: --> F

Re: Problem downloading file

2004-11-23 Thread Dakota Jack
When you do this, Radu, how does the file show up in the client? Is it downloaded to a directory the client user chooses or is it displayed in the client browser? Thanks. Jack On Tue, 23 Nov 2004 20:24:59 +0200, Radu Badita <[EMAIL PROTECTED]> wrote: > I have the same problem trying to do the

Re: Problem downloading file

2004-11-23 Thread Radu Badita
I have the same problem trying to do the same as Morales... To overcome this, i've made a JSP (just because i was too lazy to write a Servlet :) where I get the OutputStream from the response, set the content type and content-disposintion: response.setContentType("application/octet-stream");

Re: Problem downloading file

2004-11-23 Thread Dakota Jack
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. Ja

Problem downloading file

2004-11-23 Thread Morales de Frías, David
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 di