Welcome Guest, Not a member yet? Register   Sign In
unzip files
#1

[eluser]lord_nerevar[/eluser]
Hi all, i'm a newbie of CI.

I am trying to make a controller which print the content of a log file on the screen, but this log is compressed into a .zip file. So i thought that the first thing i have to do was unzip the file into a temp folder.

I tried with this code, but it doesn't work.

Code:
<?php

class Zippo extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $zip = new ZipArchive();
        $file = "/file/20100501.zip";
        
        if($zip->open($file)===TRUE)
        {
            $zip->extractTo("/file/20100501/");
            $zip->close();
            echo "File estratto con successo!";
        }
        else echo "Errore nell'apertura";
    }
}

?>

result: Errore nell'apertura.


Messages In This Thread
unzip files - by El Forum - 05-01-2010, 06:55 AM
unzip files - by El Forum - 05-01-2010, 10:11 AM
unzip files - by El Forum - 05-01-2010, 06:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB