final String filepath;
final String filename;

new Link("download") {
   void onclick() {

       final WebResponse r=(WebResponse)getResponse();

       RequestCycle.setRequestTarget(new IRequestTargeT() {
            void respond() {
                r.setAttachmentHeader(filename);
                 Streams.copy(new FileInputStream(filepath), getRequest().getOutputStream());
            }
      }
 }

you can extrapolate that into a component

-Igor


On 6/30/06, Richard Livingstone <[EMAIL PROTECTED] > wrote:

I guess the same can be provided for file links. For example, I am writing a
demo application using Wicket for an online voting application for a UK
broadcaster and one of the outputs is a file which gets emailed out to a
user. I also want it to be accessible from a link (at the moment it exists
in /var/tmp on my server) so as per the image resource it could just be
streamed. It seems a lot of work though to do it like this for a simple file
link - is there an easier way in Wicket that you might think of (I'm a
newbie at this framework so any suggestions would be helpful)


--
View this message in context: http://www.nabble.com/Image-upload-tf1487150.html#a5126218
Sent from the Wicket - User forum at Nabble.com.


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to