For adding a whole directory files need to read directory files one by one and add in the ziparchive class object. Phpexcel is a pure php library for reading and writing spreadsheet files and codeigniter is one of the well known php mvc framework. Codeigniter s zip encoding class classes permit you to create zip archives. Following is the code i am using to force download some files on my server in codeigniter. This php project with tutorial and guide for developing a code. Multiple file import by zip file bcitcicodeigniter. Create and download zip file in codeigniter makitweb. Codeigniter consistently outperforms most of its competitors. Codeigniter framework you can do many tasks very easily. In this article we are going to see how to zip, save, download a f ile in codeigniter php framework. Archives can be downloaded to your desktop or saved to a directory. Stack overflow for teams is a private, secure spot for you and your coworkers to find and share information.
Previous article is about how to upload a file using codeigniter php framework. Codeigniter is an application development framework a toolkit for people who build web sites using php. Extract zip files in codeigniter without installing any pecl extensions for php. There have been a number of refinements since version 2, notably with the database, session handling and encryption. I downloaded the files using ftp from server and checked and they just opened fine. Free download product management system codeigniter mvc. The downloaded file is corrupt and ms excel is not able to open it. Codeigniter encourages mvc, but does not force it on you.
How to zip, save and download a file in codeigniter. Product management system codeigniter mvc is a open source you can download zip and edit as per you need. It is a nice way to download from server without any hassle just writing one single controller method. Code sample how to create excel file phpexcel in codeigniter. Codeigniter has a nice helper function to download files. Codeigniter already provided a zip library that allows either add files or a directory for compress. Product management system codeigniter mvc project is a web application which is developed in php platform. Codeigniter zip encoding class with tutorial and examples on html, css, javascript, xhtml, java. Codeigniter s zip encoding class permits you to create zip archives. Want to be notified of new releases in adrienvbuildigniter. Codeigniter 3 has a 2mb download, including the user guide. Create and download zip file in codeigniter in php, ziparchive class is used for creating a zip file. So i wrote a little function to import a zip file archive extract all the files, and import them into a specific folder category named folder thats database driven this is more designed for images with say a gallery in mind, but it can easily be adopted to be used with almost any file type. Codeigniter zip encoding class tutorial and example.
881 89 794 1337 390 1131 1243 1501 1020 46 867 1144 1169 520 488 1292 538 758 152 1334 790 1365 1249 779 908 51 1257 350 67 1450 372 1053 417 228 1347 632 632 912 616