2
votes

I am using zip library to zip a folder or directory

My path structure is

   $estructure = "/home/administrator/Downloads/pdf_files/" 

And iam zipping folder using below code

   $this->zip->read_dir($estructure);
   $this->zip->archive('/var/www/');
   $this->zip->download('folder_name.zip');

Now problem is when I extract compressed directory it gives full path like

  /home/administrator/Downloads/pdf_files/

what I need is when I extract the zip file its should only diretcory like pdf_file,

Could any help me on that please? thanks

1
What code are you using to extract the file? - Smit Raval
I am not using code to extract, using Archive mounter software. - jikos

1 Answers

1
votes

Ok I got answer

  $this->zip->read_dir($estructure,FALSE);
  ob_end_clean();

Its working fine now.