Jump to content

Problem storing generated zip file on server


RandomHero

Recommended Posts

Hi all, i'm currently using a class to generate a zip file. The class is available here
[url=http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php]http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php[/url]

[code]<?
        require ("incl/zipfile.inc.php");

        $zipfile = new zipfile();
     
        $filedata = implode("", file("incl/zipfile.inc.php"));

        $zipfile->add_dir("incl/");
        $zipfile->add_file($filedata, "incl/zipfile.inc.php");

        ## I don't want to use that part of the script ##
        ## I want to store the zip file on the server ##
     
        header("Content-type: application/octet-stream");
        header("Content-disposition: attachment; filename=zipfile.zip");
        echo $zipfile->file();
?>[/code]


The way the class is programmed, it generates the zip file and with the headers it force the browser to download it.

My problem is I want to use that class to zip some files on my server but I don't want to download it. I want the script to store the zip file somewhere else on the server. Unfortunately, I don't know the way to proceed, can somebody help me?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.