Welcome Guest, Not a member yet? Register   Sign In
Problem Zip.
#1

[eluser]Browser[/eluser]
Hello all, i have the new code:

function comprimir($nombre) {
$this->load->library('zip');
$this->zip->read_file('http://localhost/searchmedic2/uploads/'.$nombre,TRUE);
$this->zip->download('my_backup.zip');
}

But, it don`t compile the file, why ?

Thanks you.
#2

[eluser]Ben Edmunds[/eluser]
Hey,

You'd probably be better off putting this under the Code and Application forum.

You need to supply a the full folder path to read_file. So on windows it'd be something like c:\wamp\www\searchmedic2\uploads\ or on linux something like /var/www/searchmedic2/uploads/.
#3

[eluser]jlew[/eluser]
I would guess that the read_file expects a file path not a url. Your read_file should be something like ./uploads/$nombre (or wherever the uploads directory is in relation to your index.php)
#4

[eluser]Ben Edmunds[/eluser]
Beat ya to it jlew Wink
#5

[eluser]jlew[/eluser]
[quote author="Ben Edmunds" date="1257760646"]Beat ya to it jlew Wink[/quote]
Yep, I noticed, by seconds!
#6

[eluser]Browser[/eluser]
But, i want to do a file with several files:

$this->zip->read_file('./uploads/'.$nombre,TRUE);
$this->zip->read_file('./uploads/curriculum1.zip',TRUE);

This, only put a one file en the file.zip. why?
#7

[eluser]Ben Edmunds[/eluser]
That should work fine.

Are you sure curriculum1.zip exists at that location?




Theme © iAndrew 2016 - Forum software by © MyBB