I am currently trying to create a content uploading system and although there are error being made from the page when I check the appropriate folder for the contents it is empty
$chapterZip = new ZipArchive();
if ($chapterZip->open($_FILES['chapterUpload']['name']))
{
for($i = 0; $i < $chapterZip->numFiles; $i++)
{
$pictureName = $chapterZip->getNameIndex($i);
$fileOpened = $chapterZip->getStream($pictureName);
if(!$fileOpened) exit("failed\n");
while (!feof($fileOpened)) {
$contents = fread($fileOpened, 8192);
// do some stuff
if(copy($contents,"Manga/".$_POST['mangaName']."/".$_POST['chapterName']."/".$pictureName.""))
{
if(chmod("Manga/".$_POST['mangaName']."/".$_POST['chapterName']."/".$pictureName."", 0664))
{
$errmsg0.= "File successfully copied<br/>";
}
else
{
$errmsg0.= "Error: failed to chmod file<br/>";
}
}
else
{
$errmsg0.= "Error: failed to copy file<br/>";
}
}
fclose($fileOpened);
}
}
Any help with this problem would be much appreciated