OwlCyberSecurity - MANAGER
Edit File: unzip.php
<?php // Get the directory where this PHP script is located $scriptDirectory = __DIR__; // Path to the zip file (which should be in the same directory as the PHP script) $zipFilePath = $scriptDirectory . '/homes.zip'; // Path to extract to (same directory as the PHP script) $extractTo = $scriptDirectory; // Check if the zip file exists if (!file_exists($zipFilePath)) { die('Zip file does not exist at the specified path: ' . $zipFilePath); } // Initialize PHP's ZipArchive class $zip = new ZipArchive; // Try opening the zip file if ($zip->open($zipFilePath) === TRUE) { // Extract the contents of the zip file to the specified directory if ($zip->extractTo($extractTo)) { echo 'Extraction completed successfully.<br>'; } else { echo 'Extraction failed.'; } // Close the zip file $zip->close(); // List the files in the extraction directory for debugging purposes $files = scandir($extractTo); if ($files !== false) { echo 'Extracted files:<br>'; foreach ($files as $file) { echo $file . '<br>'; } } } else { echo 'Failed to open the zip file.'; } ?>