public function getFileURL($file)
{
$url = "";
// find the file
$afile = TaskFile::find($file->id);
if (!$afile) {
return "";
}
// get corresponding taskevent so that we can get at the event_id
// used to segment files per event
$taskevent = TaskEvent::find($afile->taskevents_id);
if (!$taskevent) {
return "";
}
$url = $this->aws_client->getObjectUrl($this->aws_config['bucket'], "files/events/{$taskevent->events_id}/" . $afile->path, '+60 minutes', array('ResponseContentDisposition' => 'attachment; filename=' . $afile->original_filename, 'ResponseContentType' => 'application/octet-stream'));
return $url;
}