Closed Adedoyin-Emmanuel closed 5 months ago
Good idea. This is possible with output buffers and the ziparchive library in php:
As an alternative to ziparchive and tmpfile, I could use ZipStream. However, that would complicate the project somewhat.
This is probably something that I should do, but if someone thinks that they can do it, I'm happy to assign.
@chriskthomas can you assign the task to me
@chriskthomas can you assign the task to me
Sure! I think you'll want to:
api.php
so that it always writes to an output bufferindex.php
for zipping the fileapi.php
sees that the checkbox is false: print the output buffer and exitapi.php
sees that the checkbox is true: (1) create a tempfile zip archive, (2) add the output buffer as a string to the archive, and (3) send the archive as a download@Adedoyin-Emmanuel are you still interested in doing this? Let me know if you need any help.
We can add an option to make the user download the index.html file as a zipped file so they can easily deploy it on Netlify
pages.