1 Reply Latest reply on Apr 9, 2010 6:30 PM by Gaël Beaudoin

    Download file inside seam pdf

    Shervin Asgari Master

      Hi.


      Does anybody know how I can initiate a download of a file from a seam pdf?


      This is the portion of the code I have right now.


      <p:html>
      <a:repeat var="file" value="#{attachment.files}" rowKeyVar="row">
      <s:link action="#{fileHandler.downloadById()}" value="#{file.name}" >
              <f:param  name="fileId" value="#{file.id}"/>
      </s:link>
      </a:repeat>



      This generates a link on the pdf with the link:


      /project/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById()&cid=16



      This is obviously an invalid link, however, if I change /project to the servletpath,


      localhost:8080/saksapp/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById%28%29&cid=16



      Then the download file dialog appears. Now, does anybody know how I can achieve this?