Articles Posted in the " Yii Zip " Category

  • Yii Zip Format

    Yii Zip Format

    In this article, I explained about “How to handle zip files” in yii framework. I used this code to my project for handling the zip files. Here i added source code to create, Extract, […]


  • Delete zip file in yii

    Delete zip file in yii

    Delete Zip Files Using PHP Here i added this code to delete the zip files inside the folder of yii framework. SourceCode: public function actionDeletefile($id,$docid) { $error=''; $filepath=Yii::app()->basePath.'/files/'.$zipfilename.".zip"; $zip = new ZipArchive; if ($zip->open($filepath) […]


  • Download Zip files in yii

    Download Zip files in yii

    Download Zip Files Using Yii Here i added the code to download the Zip files in yii folder. SourceCode: public function downloadfinal($docid,$docname) { $filename=Dirdetails"filename.zip"; if(file_exists($filename)){ $path_parts = pathinfo($filename); $ext = strtolower($path_parts["extension"]); switch ($ext) { […]


  • Create zip file in yii

    Create zip file in yii

    Create Zip Files Using PHP I added the source code to create a zip file in yii. public function actionCreatefile($filename,$filelist) { $zip=new ZipArchive(); $destination=DIRDetails."/filename.zip"; if($zip->open($destination,ZIPARCHIVE::CREATE) !== true) { return false; } foreach($filelist as $thefile) […]


  • Extract zip files in yii

    Extract zip files in yii

    Extract Zip Files Using Yii I added the source code to extract the zip files using yii SourceCode: public function actionExtractfile($filename) { $filename='filename'; $zipfile=DirDetails."/filename.zip"; $zip = zip_open($zipfile); $extract=DirDetails."/newfolder"; if ($zip) { if(!is_dir($extract)) mkdir($extract); while […]


  • Update Zip files in yii

    Update Zip files in yii

    Update Zip Files Using PHP I added the source code to add new file into existing zip files. SourceCode: public function actionUpdatezip($zipfilename,$filelist){ $destination=Yii::app()->basePath.'/files/'.$zipfilename.".zip"; $zip=new ZipArchive(); if(!$zip->open($destination)) { return false; } if($filelist) { foreach($filelist as […]