I want to create zip file for download but i dont want to save it.
Just like this image code
Code: Select all
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>But if i write something like that
Code: Select all
<?php
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=test.zip");
$archivename = "test.zip";
$zipobject = new ZipArchive();
$zipobject->open($archivename, ZipArchive::CREATE);
$zipobject->addFile("a.php");
$zipobject->close();
?>I dont want to save file
Just give it user and destroy itself
You can write your alternate ideas
Thanks for your answers...