CodeIgniter Forums
unzip files - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: unzip files (/showthread.php?tid=30055)

unzip files - El Forum - 05-01-2010

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.


class Zippo extends Controller {

    function Welcome()
    function index()
        $zip = new ZipArchive();
        $file = "/file/";
            echo "File estratto con successo!";
        else echo "Errore nell'apertura";


result: Errore nell'apertura.

unzip files - El Forum - 05-01-2010

You didn't load your library.

unzip files - El Forum - 05-01-2010

[quote author="Tominator" date="1272748303"]You didn't load your library.[/quote]there was two errors:

- the path ( file/ instead of /file/
- permission of the folder (i work on ubuntu linux)

now it works. is not a library of CI, is a function of PHP 5