I need to get the images file name in a zip file that uploaded to s3 without download or save, is that possible? Currently i'm only able to make it if file are store in local.
here is my code:
$z = new ZipArchive();
$url = public_path('storage\\' . $asset->getRawOriginal('path'));
$names = [];
if ($z->open($url)) {
for ($i = 0; $i < $z->numFiles; $i++) {
$stat = $z->statIndex($i);
array_push($names, basename($stat['name']));
}
}
natsort($names);
$names = array_values($names);
return $names;
Is there any method to do so?