CodeIgniter Forums
Upload, Unzip, Get data - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Upload, Unzip, Get data (/thread-12959.html)



Upload, Unzip, Get data - El Forum - 11-05-2008

[eluser]Ignacio[/eluser]
Hello everybody, I'm trying to build a webapp.

I need Upload .zip files. Easy, using the File Uploading Class.

Now, Unzip the file. Using the Zip Encoding Class, or http://codeigniter.com/wiki/Unzip/, I didn't test it yet, but this is not the issue.

Now the problem, I want to get the data ($this->upload->data()Wink for each of the files on the .zip.

This can be done? Any idea?

Thanks!


Upload, Unzip, Get data - El Forum - 11-05-2008

[eluser]lmv4321[/eluser]
I would create an empty temp directory and then unzip the files to this directory. Then using the File Helper, get a list of the file names. Then again using the File Helper, loop thru these file names and read in the data and do what ever else you want with them.
When done with the files, delete the files and the temp directory.


Upload, Unzip, Get data - El Forum - 11-05-2008

[eluser]Ignacio[/eluser]
lmv4321, thanks for your fast response, I'm trying to do something like that now, thanks again.