php - Yii2 - Multiples files download from Folder

159

I have a issue with Yii2 and multiple download. I'm using Fpdf to generate PDF and save them on a folder. This is ok, but when I try to download all of them from that folder, he just return me one file, the first one:

 for($x = 1; $x <= $vlt; $x++){
        if (file_exists($tempPath.'Client'.$x.'.pdf')) {
            Yii::$app->response->sendFile($tempPath.'Client'.$x.'.pdf');
        }
    }

I donĀ“t understand why this happen.

Thank you.

People are also looking for solutions to the problem: json - Group array by value php

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.