RE: Download Content using Struts action class
Thank you very much Ernest!!! It works like a charm. -Original Message- From: Ernest Jones [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 3:45 PM To: [EMAIL PROTECTED] Subject: Re: Download Content using Struts action class I'm working on a similar thing and adding this line seems to help: response.setHeader("Content-Disposition","attachment; filename=\"" + myFileName+ "\";"); - Original Message - From: "Gail Xiang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 21, 2001 1:36 PM Subject: Download Content using Struts action class > Hi, > I have a question about downloading files using Struts action class. > The link for the Download is: > > href="downloadContent.do?action=download&mimetype=<%=strMimeType%>&dir=<%=st > rDir%>">Download > > in which downloadContent.do is mapped to an action class. It works > fine functionally. > > However, when the "File Download" dialogue box is prompted, and the > user selects "Save this file to disk", the default name given in the "File > name" box in the next dialogue screen is "downloadContent.do" instead of the > file name. > > I tried to add /<%=filename%> after the "downloadContent.do" and was > hoping the <%=filename%> would show up as the default file name. This did > not work since server does not know how to interpret > downloadContent.do/<%=filename%>. > > One interesting observation is if directly uses a jsp page to handle > the action, such as: > > href="download.jsp/<%=filename%>?action=download&mimetype=<%=strMimeType%>&d > ir=<%=strDir%>">Download > > the <%=filename%> does show up as the default file name in the "save > as" screen. However, in my case I have to use an action class not a jsp > because jsp does not work functionally although it could recognize the file > name on the other hand. > > Any hints would be appreciated! > > Thanks. > > -Gail
Re: Download Content using Struts action class
I'm working on a similar thing and adding this line seems to help: response.setHeader("Content-Disposition","attachment; filename=\"" + myFileName+ "\";"); - Original Message - From: "Gail Xiang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 21, 2001 1:36 PM Subject: Download Content using Struts action class > Hi, > I have a question about downloading files using Struts action class. > The link for the Download is: > > href="downloadContent.do?action=download&mimetype=<%=strMimeType%>&dir=<%=st > rDir%>">Download > > in which downloadContent.do is mapped to an action class. It works > fine functionally. > > However, when the "File Download" dialogue box is prompted, and the > user selects "Save this file to disk", the default name given in the "File > name" box in the next dialogue screen is "downloadContent.do" instead of the > file name. > > I tried to add /<%=filename%> after the "downloadContent.do" and was > hoping the <%=filename%> would show up as the default file name. This did > not work since server does not know how to interpret > downloadContent.do/<%=filename%>. > > One interesting observation is if directly uses a jsp page to handle > the action, such as: > > href="download.jsp/<%=filename%>?action=download&mimetype=<%=strMimeType%>&d > ir=<%=strDir%>">Download > > the <%=filename%> does show up as the default file name in the "save > as" screen. However, in my case I have to use an action class not a jsp > because jsp does not work functionally although it could recognize the file > name on the other hand. > > Any hints would be appreciated! > > Thanks. > > -Gail
Download Content using Struts action class
Hi, I have a question about downloading files using Struts action class. The link for the Download is: Download in which downloadContent.do is mapped to an action class. It works fine functionally. However, when the "File Download" dialogue box is prompted, and the user selects "Save this file to disk", the default name given in the "File name" box in the next dialogue screen is "downloadContent.do" instead of the file name. I tried to add /<%=filename%> after the "downloadContent.do" and was hoping the <%=filename%> would show up as the default file name. This did not work since server does not know how to interpret downloadContent.do/<%=filename%>. One interesting observation is if directly uses a jsp page to handle the action, such as: Download the <%=filename%> does show up as the default file name in the "save as" screen. However, in my case I have to use an action class not a jsp because jsp does not work functionally although it could recognize the file name on the other hand. Any hints would be appreciated! Thanks. -Gail