I am using wicket framework, and I have made a zip file by Java code, I want to have a link to download it, I don’t know if it is possible or I should make the zip file by wicket (but not Java) and then have a link to download.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look at
ZipResourceStream. With this class you can generate zip contents of a directory on the fly, and use aorg.apache.wicket.markup.html.link.ResourceLinkwithResourceStreamResourceto link to it.Alternatively, if you prefer to zip the file with another tool, you can use
DownloadLink:If you prefer to generate the File on the fly in the Link’s onClick, take a look at this question: How to use Wicket’s DownloadLink with a file generated on the fly?