开发者

Generating files/folders?

开发者 https://www.devze.com 2023-04-02 04:28 出处:网络
This might be a horrifically stupid question, but how would I go about doing this in PHP: I\'d like to make a .zip file dynamically, then serve it as a download immediately with force-download mime o

This might be a horrifically stupid question, but how would I go about doing this in PHP:

I'd like to make a .zip file dynamically, then serve it as a download immediately with force-download mime or something, with the contents of $string, with a folder structure.

Premade folder structure license\keys\{$_SERVER['REMOTE_ADDR']}\{$fn}.cf and {$fn}.cf would contain the contents of $string, inside the .zip file

I have literally no idea where 开发者_JAVA百科to start.


You could use the ZipArchive class. Use it to create a temporary ZIP file, close the ZipArchive, stream the temporary ZIP file to the user, and delete the temporary ZIP.

0

精彩评论

暂无评论...
验证码 换一张
取 消