php - Image Rename Zip And Download codeigniter -


currently zip downloading , images within zip off names stored on server need rename them have 3 images on server need download images before adding files zip need rename them

public function downimages(){ 

$this->_check(); // session checker

$this->load->helper('download');

$this->load->library('zip');

$idm=$this->uri->segment(3);

$ab=$this->adminmod->downimg($idm);

$down=explode('-/,-', $ab[0]->director); //gets directory stores in array

$fname=explode('-/,-', $ab[0]->file_oname); //gets file names stores in array

foreach ($down $key =>$value){

$name = $fname[$key]; // name stored need use this rename $data = "./"($value);

$this->zip->read_file($data); //adds images zip archive }

$this->zip->download($idm.'.zip'); //downloads zip fles

// redirect($_server['http_referer']); }

my server image names xfasf.jpg 2) sadweq.jpg 3)wqweq.jpg actual file names image1.jpg 2)blue.jpg 3)red.jpg whcih comes $name

how go this?

solution quite easy

solved @ $this->zip->read_file($data); put $name $this->zip->read_file($data,$name); files renamed before zipped , downloaded

solved @ $this->zip->read_file($data); jsut put $name $this->zip->read_file($data,$name); files renamed before downloaded


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -