public function actionFile($uri)
{
$user = \Yii::$app->user->identity;
$file = $uri; // тут преобразовываете файл
if (!file_exists($file)) {
throw new NotFoundHttpException();
}
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
//манипуляции, имеет ли пользователь доступ?
if (strpos($file, 'folder3') && $user->role == $user::ADMINISTRATOR) {
ob_clean();
flush();
readfile($file);
exit;
}
throw new NotFoundHttpException();
}
Правильней, если исходники он вам предоставит после оплаченной работы.