How to Unzip on One.com: Quick Answer Section
Is it easy to unzip on One.com?
Yes, when following the guide on this page, it is easy.
Do I need to code to unzip on One.com?
No, the code you have to use is provided here, together with complete instructions how to use it.
Is there a limit to how many times I can use this function?
No, only remeber to edit it every time by including the current .zip archive’s name.
Can I zip files on One.com using the solution here?
No. You can, of course, write your own function to zip files but it will be quite more complicated as the one provided here.
One.com is one of the most popular hosting providers, servicing customers from all around the world. So, one would expect that their service is great – and it surely is in many aspects. There is, however, one major pitfall: you cannot zip or unzip on One.com.
Being able to zip and unzip on a server is quite important, especially for digital agencies and webmasters of large websites, who need to move whole WordPress sites, install or upgrade a large theme, or upload a lot of files. If you, however, have a hosting account on One.com, you have found out that you can’t unzip there. Simply because such function isn’t integrated in their user interface.
You probably also know that there is no real alternative to zipping and unzipping. The only other way to manage multiple files is to use ftp. Or to manually upload them all, one by one, if you don’t have access to ftp. If you have tried it though, you know that this isn’t really an option, as it is very time consuming and complicated.
This post will therefore show you how you can use .zip archives and unzip on One.com by creating your own .php function.
How to Unzip on One.com – Step-by-Step
To unzip on One.com, you need to create and upload a small .php file to your hosting account. Here’s how you do it, step-by-step:
- Copy the code below and paste it into a simple text editor. A simple text editor is, for example, Notebook on Windows.
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'Successfully unzipped';
} else {
echo 'An error occurred';
}
?>
- In the code above, replace ‘file-name.zip’ with the name of your zip archive and keep the quotation marks
- Save the file as a .php file
- Keep in mind that not all text editors allow you to save a file as .php, so often you might end up with a file ending at .php.txt. If this happens, don’t worry, you can still use the file. Just remember to change the extension by using the Rename file option in File Manager, once the file is uploaded to One.com.
- Once you’ve created the file, log into your account on One.com
- Navigate to File manager and click on it to get access to your files
- Click on the blue Upload button to upload the .zip file that will later be unzipped
- Upload the .php file you created. Double-check the extension. As long as it isn’t php, select the file and click on Rename in the top right corner of the screen, as shown in the screenshot below. Change the file type by changing the extension to pure .php. You are then prompted to confirm the change of extension by clicking on Confirm in the bottom of the screen. Click on Confirm. Now, both the file extension and the color of the file icon in File Manager should have changed.
- To finalize the unzip on One.com, now you have to open the .php file in the browser. Do that by selecting the file (by setting a tick in the field placed just before the file type icon) and then clicking on the link that appears in the top right part of the screen. This is the link to the file’s location on the server.
- Once you click on the link, a new browser tab opens. It appears empty at first, while the php function is working. Then, you’ll either see a success or error message, depending on the result.
- Check, whether all files got unzipped. Sometimes unzipping on One.com ends either in no or partial unzip. If nothing gets unzipped, check whether the file name of the .zip archive in the php file is correct and check again the php file’s extension. Then try again. Partial unzips are not that uncommon either. In case of partial unzip, just open again the php file in the browser, as described above.
That’s it. Now you know how to unzip on One.com.