struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <D...@Newfield.org>
Subject Re: File download problem
Date Tue, 28 Aug 2007 19:33:27 GMT
Senthil_Kumar.Thangarathinam@alcatel-lucent.com wrote:
> I get the following error, when I try downloading files through the File 
> download Struts2 application. I have given the Configuration detail and 
> the Action class. Could someone take a look and let me know where this 
> breaks?

public InputStream getInputStream() throws Exception
does not match
public InputStream getInputStream()

Letting any user set the path:
> public void setInputPath(String value) {
>       inputPath = value;
>   }

Then returning the resource at that path:
>   public InputStream getInputStream() throws Exception {
>       return 
> ServletActionContext.getServletContext().getResourceAsStream(inputPath);
>   }

Seems like a pretty big security hole.  Are you sure this is what you 
want to do?

-Dale

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


Mime
View raw message