Created
April 29, 2014 14:09
-
-
Save steffenr/11401484 to your computer and use it in GitHub Desktop.
Programmatically create file-download link (file_entity / Drupal)>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get download uri of actual file. | |
$uri = file_entity_download_uri($file); | |
// We need query-params for download-token here. | |
$dl_link = l(t('Download'), $uri['path'], array('query' => $uri['options']['query'])); | |
print $dl_link; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment