webman使用:我現(xiàn)在服務器有幾個小文件,是上傳上來分開保存的,現(xiàn)在想做下載功能,怎么能把這些小文件合并輸出給瀏覽器,讓客戶只下載一個文件。
之前嘗試過
$response = response();
$response->header(xxx);
$response->withFile('文件路徑1');
$response->withFile('文件路徑1');
$response->withFile('文件路徑3');
return $response;
但是他只輸出最后一個文件,不是合并的。
也試過循環(huán)下面這個
ob_start();
echo 文件流;
$image = ob_get_clean();
$response->withBody($image);
return $response;
確實可以輸出,但是下載失敗;求解怎么解決這個問題,非常感謝。