0

How can i get the zipped file folder name after unzipping in php.

$zip = new \ZipArchive();

$zip->open(storage_path('app/'.$request->vrfile));

$zip->extractTo(public_path('tour_videos/videos/'.str_slug($company)));
$zip->close();

unlink(storage_path('app/'.$request->vrfile));

Zipped file is called Kigali Home Web Tour

enter image description here

And After Unzipping the file the folder name is Web Tours

enter image description here

How can i get the folder name after extracting zipped files??

Marvin Collins
  • 379
  • 6
  • 14

1 Answers1

0
$name = $zip->open(storage_path('app/'.$request->vrfile));

$name will give you an absolute path as well as the name of your folder.

Ankita Mehta
  • 442
  • 3
  • 16