I am trying to upload file in filemanager but it stuck at half even size of zip is below 10MB
-
I choose option to upload and unzip(ZIP file size 26KB)
-
Also I tried to upload zip file(ZIP file size 26KB) but zip file dose not extracted it shows only loading icon.
TrustF
2
unfortunately there seems to be some issue with unzip in ftp, but there is a fix for this, follow there steps:
- just upload file.zip (don’t use upload and unzip)
- make un.php file in the same directory as that of zip uploaded.
- copy the below code to un.php
<?php
$zip = new ZipArchive;
if ($zip->open('file.zip') === TRUE) {
$zip->extractTo('./');
$zip->close();
echo 'Unzipped Process Successful!';
} else {
echo 'Unzipped Process failed';
}
?>
- Now
https://your-website.com/un.zip
- This will unzip content of your zip.
1 Like
Okay Thanks I Am Trying It If It Not Works I Will Revert
TrustF
4
sure, it will do the job, do not worry.
Easier way would be to just extract the files locally and upload with a desktop FTP client like FileZilla.
7 Likes
Thanks & I will try this next time
Thanks It’s working and I would like to update this code
<?php
//For Multiple Files
$zipFiles = ['libs.zip', 'another.zip', 'build.zip'];
foreach ($zipFiles as $zipFile) {
$zip = new ZipArchive;
if ($zip->open($zipFile) === TRUE) {
$zip->extractTo('./');
$zip->close();
echo "Unzipped $zipFile Successful!<br>";
} else {
echo "Unzipped $zipFile failed<br>";
}
}
//For Files From Hidden Folder
$zipFiles = ['plugins/plugins_fastclick.zip', 'plugins/plugins_icheck.zip', 'plugins/plugins_jszip.zip', 'plugins/plugins_pace.zip',];
$destinationDirectory = 'plugins/';
foreach ($zipFiles as $zipFile) {
$zip = new ZipArchive;
if ($zip->open($zipFile) === TRUE) {
$zip->extractTo($destinationDirectory);
$zip->close();
echo "Unzipped $zipFile Successful!<br>";
} else {
echo "Unzipped $zipFile failed<br>";
}
}
?>
1 Like
system
Closed
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.