I have a situation, I have list of user data, in that data details, i have stored a file also. Now i want to download all the file of users in zip file, when a user click on a button like DOWNLOAD.
i have written a action in controller where im fetching the file to be downloaded, but im unable to write code for making zip finle and download it. Below is my code in controller.
public function actionMain($jid)
{
$values = UserRequest::find()->where(['sender_code'=>$jid,'status'=>1])->all();
$i=1; foreach($values as $data) {
$users = Users::find()->where(['access_code'=>$data->reciever_code])->one();
$file_names[]= $users->attach_cv;
}
}
This is working fine. in $file_name im fetching all the file's, But i want to download this files in a zip foder.
Please help me to solve this issue
The link provided is in core php and easily implemented in that. But how about doing the same in framework. Because i have array of file name in action. As you can see above. DO i need to write the code for generating .ZIP in the same action or any other action.