Sebastian Knoerzer wrote:

hi,

i have the following problem.
i have an asset (a pdf file) and i want to download that if the user
clicks on a directlink, but i always get a filenotfoundexception
if i try to generate the fileinputstream-object.



I am not sure if this is the best way to do that but I actually wrote a special "download link" component for that (stronly inspired by Konstantin's response: http://article.gmane.org/gmane.comp.java.tapestry.user/19288/match=content++type++service).


You can use it like that:

   <component id="myLink" type="DownloadLink">
       <binding name="dirName" expression="assetDir"/>
       <binding name="fileName" expression="asset"/>
       <static-binding="contentType" value="put your content type here"/>
   </component>


You need to register a new service in you .application file <service name="DownloadService" class="package.DownloadService"/>


Code is here:

http://scm.sipfoundry.org/rep/sipXconfig/main/web/src/org/sipfoundry/sipxconfig/components/DownloadService.java
http://scm.sipfoundry.org/rep/sipXconfig/main/web/src/org/sipfoundry/sipxconfig/components/DownloadLink.java

Damian







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to