[TYPO3-mvc] Download link with FAL

Frans Saris franssaris at gmail.com
Wed Jun 4 10:02:12 CEST 2014


Have a look at
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Resource/FileReference.php

All the public methods can be accessed in fluid (leave out the get part of
the method name and first character lower case).
To get the other metadata properties you can use
{file.originalResource.properties.[metadata property]}

For example:
{file.originalResource.properties.title}
{file.originalResource.properties.description}
{file.originalResource.properties.width}
{file.originalResource.properties.height}

gr. Frans


2014-06-03 22:15 GMT+02:00 Bas van der Togt <bas at profinit.com>:

> Ok tnx. But where can i find which properties i can use even more?
>
> Frans Saris schreef op 03-06-14 21:49:
>
>  Thats because it a public method and not a property of the File object.
>>
>> Gr. Frans
>> Op 3 jun. 2014 21:20 schreef "Bas van der Togt" <bas at profinit.com>:
>>
>>  Thanks a lot Frans! That's what i was looking for :-)
>>> Any idea why i don't see property publicUrl when i do a debug:
>>> <f:debug>{file.originalResource}</f:debug> ?
>>>
>>> Frans Saris schreef op 03-06-14 20:12:
>>>
>>>  Hi Bas,
>>>>
>>>> just use
>>>>
>>>> <a href="{file.originalResource.publicUrl}">Download</a>
>>>>
>>>> publicUrl gives a direct link to the file when possible or else a link
>>>> to
>>>> the file eID script (only since 6.2)
>>>>
>>>> gr. Frans
>>>>
>>>>
>>>> 2014-06-03 18:19 GMT+02:00 Bas van der Togt <bas at profinit.com>:
>>>>
>>>>   Hello list,
>>>>
>>>>>
>>>>> What is the best way to make a file download in fluid with FAL?
>>>>>
>>>>> Now i have: <a href="{f:uri.image(src: file.file.uid,
>>>>> treatIdAsReference:
>>>>> 1)}" target="_blank">Download</a>
>>>>>
>>>>> But i suppose there's a better way.
>>>>>
>>>>> Best regards,
>>>>> Bas
>>>>> _______________________________________________
>>>>> TYPO3-project-typo3v4mvc mailing list
>>>>> TYPO3-project-typo3v4mvc at lists.typo3.org
>>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-
>>>>> project-typo3v4mvc
>>>>>
>>>>>
>>>>>  _______________________________________________
>>> TYPO3-project-typo3v4mvc mailing list
>>> TYPO3-project-typo3v4mvc at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>>>
>>>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list