extract uploaded zip files - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: extract uploaded zip files (/showthread.php?tid=25283) |
extract uploaded zip files - El Forum - 12-07-2009 [eluser]thematrixuum[/eluser] Here's my view : Code: <div class="content"> Here's my controller : Code: function uploadify() { and here's my model : Code: function unzip($file_path, $file_name) { I don't know waht is the problem but it seems that I cannot extract the zip file uploaded into the server.. Can anybody help me? Thanks a mil.. extract uploaded zip files - El Forum - 12-10-2009 [eluser]imn.codeartist[/eluser] look at this line of code $zip->extractTo(base_url().'assets/upload/'); To extract zip file you need physical path location where base_url() is not a actual physical path extract uploaded zip files - El Forum - 12-10-2009 [eluser]thematrixuum[/eluser] thanks for the reply. how can i retrieve the physical path of the file? extract uploaded zip files - El Forum - 12-10-2009 [eluser]imn.codeartist[/eluser] are you running in the local windows ? for example "C:\xampp\htdocs\mydir"; if yes then $zip->extractTo($_SERVER['DOCUMENT_ROOT'].‘/mydir/assets/upload/’); extract uploaded zip files - El Forum - 12-10-2009 [eluser]thematrixuum[/eluser] yes current development is in windows. but the server is in unix environment. when the server is live, what should i change? thanks for the reply. extract uploaded zip files - El Forum - 12-10-2009 [eluser]imn.codeartist[/eluser] if you are in live server for example "http://www.example.com" and you wanna upload in ‘/assets/upload/’ which means http://www.example.com/assets/upload/ then just use $zip->extractTo($_SERVER[‘DOCUMENT_ROOT’].‘/assets/upload/’); extract uploaded zip files - El Forum - 12-10-2009 [eluser]thematrixuum[/eluser] cool.. thanks for the reply.. |