Notifications
Clear all
Topic starter 27/09/2022 10:37 am
I was working on a WordPress website migration where customer was moving their WordPress blog to one.com shared hosting. I had a WordPress website in a zip folder.
But after uploading the zip file to one.com hosting account with their file manager. I realized that there's no way to extract the zip file. I didn't want to upload unzipped content over FTP because it would take so much time and I'm on a limited data connection.
So, I used following php snippet to unzip the file I had already uploaded. You need to create a new file and save it with following content. Remember to change file-name.zip with your filename and save this php file in the same directory as the zip file you want to unzip.
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'It did not work';
}
?>Open file with your browser to unzip the file.
This topic was modified 3 years ago 3 times by Tharindu