国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman怎么合并輸出幾個小文件?

zfxcms

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;
確實可以輸出,但是下載失敗;求解怎么解決這個問題,非常感謝。

1351 2 2
2個回答

walkor 打賞
$content = file_get_contents($file1);
$content .= file_get_contents($file2);
return response($content)->withHeaders([
    'Content-Disposition' => 'attachment; filename=' . urlencode('文件名'),
    'Content-Type' => 'application/octet-stream',
]);
tibaiwan

幾個小文件打個壓縮包

  • 暫無評論
年代過于久遠,無法發(fā)表回答
??