Jump to content

Attachment file name in database template


Recommended Posts

I am displaying a link to download an attachment to a database record like this:

{{if $record->field_204}}
    <a class="gamebutton" href='https://s3.us-east-2.amazonaws.com/xxxxxxxxxxxxx/{$record->field_204}'><b>Download</b></a>

I don't think this is right because the downloaded file has a scrambled name like "FileName_zip.JHDF2342387fhdjfs875489242"

What is the correct way to do this?

Link to comment
Share on other sites

I've replied to your ticket, but I'm also going to reply here just for the case that somebody else finds this question via the search..

You need to use the helper method customFieldDisplayByKey('yourKey') or $fieldObject->DisplayValue($record->field_204) to get the proper value. Please see also 

You could also just use the IPS\File helper in the template


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...