CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

« Previous - Version 8/38 (diff) - Next » - Current version
Peter Klein, 2009-09-14 19:26


PMK Forced Download

Example of usage as extended stdWrap parameter (Requires TYPO3 v4.2+):

10 = TEXT
10.value = download
10.typolink.parameter = fileadmin/templates/images/dwarf_male120x.gif
10.typolink.parameter.forceDownload = 1

Example of usage as userFunction:

10 = TEXT
10.value = download
10.typolink.parameter = fileadmin/templates/images/dwarf_male120x.gif
10.typolink.parameter.postUserFunc = tx_pmkfdl_makedownloadlink->makeDownloadLink

This link will open up a requester in the browser, asking the user what he wants to do with the file (Save, Open etc.)

If the typolink points to a valid file, then the link will be modified to something like this:

http://www.mydomain.com/index.php?eID=pmkfdl&file=fileadmin%2Ftemplates%2Fimages%2Fdwarf_male120x.gif&ck=a94fad5a0262b2e00e1aa72e8aac4c30

A MD5 checksum is added as a 2nd parameter to insure that it is the correct file that is being downloaded.
(If the MD5 checksum doesn't match the file, then the download will be terminated.)

Forced download

If you want to force a download, without opening up the browser requester, you can add a special option/parameter called "forcedl"

Example of usage as extended stdWrap parameter, with "forcedl" set (Requires TYPO3 v4.2+):

10 = TEXT
10.value = download
10.typolink.parameter = fileadmin/templates/images/dwarf_male120x.gif
10.typolink.parameter.forceDownload = forcedl

Example of usage as userFunction, with "forcedl" set:

10 = TEXT
10.value = download
10.typolink.parameter = fileadmin/templates/images/dwarf_male120x.gif
10.typolink.parameter.postUserFunc = tx_pmkfdl_makedownloadlink->makeDownloadLink
10.typolink.parameter.postUserFunc.forceDownload = forcedl