Welcome Guest, Not a member yet? Register   Sign In
Force download file inside zip archive
#3

Thanks @mwhitney. I figured out that the native php ziparchive library has the correct methods to do the job.

PHP Code:
$unzipfolder 'media/unzipped/' $userid;
$zf 'example.zip';
chmod($zf,0777);
$zip = new ZipArchive;
if (
$zip->open($zf) === TRUE) {
 $zip->extractTo($unzipfolder '/');
 $zip->close();
 $z_content directory_map($unzipfolder);

In this example, I have a zip-archive called example.zip.
I'm creating a new zip object.
If this can successfully open the zipfile, it unzips (extractTo) the zipfile to a specified folder.
With the directory helper I can read the contents of that folder.
Reply


Messages In This Thread
RE: Force download file inside zip archive - by Wouter60 - 07-09-2015, 01:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB