Forums: How to add link to download original

  1. I would like to provide a download link the original source file that was uploaded. Could you provide the code needed to do so.

  2. You've probably seen this called on the admin side on the items show page:

    <?php echo display_files($item->Files); ?>

    That displays the file and the download link. It looks like this is what you want. Take a look at display_files() in the application/helpers/Functions.php file to see how it works if you are looking to build something of your own. $files can be an array, so you just have to handle that properly, and you could echo something as follows:

    echo '<a href="'. file_download_uri($file). '" class="download-file">'. $file->original_filename. '</a>'

Topic Closed

This topic has been closed to new replies.