This is what I’ve got so far. I need to be able to apply 0666 to all the files in the archive. Can’t I do that as I am exporting? What is a sample code for changing the chmod during unarchiving or after unarchiving?
$zip = new ZipArchive;
if ($zip->open('upload/'. $username . $file_ext) === TRUE) {
$zip->extractTo('dir/' . $username);
$zip->close();
} else {
echo 'failed';
}
Thanks for all of the help!
Brandon
Setting
0666on directories might not be what you want 😉File creation in any process in Linux will use with
0777for directories and0666for files but it depends on theumaskvalue what the final permissions will be. By default theumaskvalue is0022which creates files like0644; it works like a subtraction.So by resetting the
umaskto 0 you probably get what you need.