I have been unable to figure out if there is a way to extract a zip into a specific directory with php. When using code such as
$zip->extractTo("files/");
it will extract the zip to the directory "files" and place all the files within a directory matching the name of the zip. I don't want the uploading party to be able to decide the name of the directory being uploaded to. For example if I upload a zip called "zip.pdf" containing "myimg.jpg" when I extract it it's location becomes:
files/zip/myimg.jpg
where as I want it to be
files/myimg.jpg
Anyway, I was wondering if there is a way to just have ZipArchive NOT create a new directory to house the unzipped contents or if I will have to loop through all the unzipped files and move them once the unzip has completed.