Creating a GZipped tar file and dynamically streaming it via PHP?

前端 未结 2 1917
栀梦
栀梦 2021-01-18 08:04

Is there an easy interface like ZipArchive for tar.gz archives that allows me to stream the archive to the client rather than save it on the server? And if so, could someone

2条回答
  •  独厮守ぢ
    2021-01-18 08:30

    You can direct the tar command with passthru() or exec() to send the tar.gz file to stdout. E.g.

    tar cfz - name1 name2 ...
    

提交回复
热议问题