Manipulate an Archive in memory with PHP (without creating a temporary file on disk)

后端 未结 5 1060
太阳男子
太阳男子 2020-11-27 05:06

I am trying to generate an archive on-the-fly in PHP and send it to the user immediately (without saving it). I figured that there would be no need to create a file on disk

5条回答
  •  抹茶落季
    2020-11-27 05:25

    Regarding your comment that php://temp works for you except when you close it, try keeping it open, flushing the output, then rewind it back to 0 and read it.

    Look here for more examples: http://us.php.net/manual/en/function.tmpfile.php

    Also research output buffering and capturing: http://us.php.net/manual/en/function.ob-start.php

提交回复
热议问题