TYPO3 force download with fluid template typolink

"<f:link.typolink>" tag will not directly allow you to add jumpurl parameter. To achieve this we need the help of  typoscriptObject.
Below is an example how you can do it.

<f:link.typolink class="link" parameter="{f:cObject(typoscriptObjectPath: 'lib.files', data: '{field.link}')}" >Force Download</f:link.typolink>

 

"field.link" is the link field where you add the file link. The typoscript object "lib.files" can be defined like below.

lib.files = TEXT
lib.files {

   stdWrap.typolink.parameter.current = 1
   stdWrap.typolink.jumpurl = 1
   stdWrap.typolink.jumpurl.secure = 1
   stdWrap.typolink.jumpurl.secure.mimeTypes = pdf=application/pdf, doc=application/msword,  png=image/png, gif=image/gif, jpg=image/jpg
   stdWrap.typolink.returnLast = url

}

 

Now you should be able to add the jumpurl and your files should be downloaded.