How to unzip a zip file in the server.

Assume the file you want to unzip is ‘example.zip’.

1:Upload the zip file you want to unzip.

Upload the zip file ‘example.zip’ to the directory where you want to unzip it.

2:Creating and uploading unzip.php.

Create the following php file and upload it to the same directory as 1 above.

<?php

$scriptfullpath=(empty($_SERVER["HTTPS"]) ? "http://" : "https://").$_SERVER["HTTP_HOST"].$_SERVER['PHP_SELF'];

$filename="";
$filename= $_POST["filename"];

echo <<< EOM
<form method="post" action="$scriptfullpath">
<input type="hidden" name="mode" value="unzip">
-----Un Zip program-----<BR>
Input zip filename:<input type="text" name="filename" value="$filename">
<input type="submit" value="UNZIP">
</form>
EOM;

if(strpos($filename,'.zip') !== false){

$zip = new ZipArchive;
$res = $zip->open($filename);
if ($res === TRUE) {
$zip->extractTo('./');
$zip->close();
echo 'OK--unzip success';
} else {
echo 'error--unzip failed';
}
}else{

if($_POST["mode"] == "unzip"){echo 'error--this file is not zip file';}
}

?>

2:Access unzip.php.

Access the following url in your browser.

ex:https://yourdomain.com/unzip.php

※Please replace the “https://yourdomain.com/” with the url of your own website.

3:Deployment of zip.

When the ‘Input Zip file name:’ input field appears, enter the name of the zip file you want to extract, ‘example.zip’, and click the ‘Extract’ button.

4:Finish.

「OK–unzip success」is displayed and the process is complete.

Code Speed Web Wordpress

Without plugins!Contact Form 7 How to load js and css only on specified pages.|WordPress

Learn how to make ContactForm7 js and css load only on specified pages in WordPress without using a plugin. Normally, when ContactForm7 is installed, js and css are loaded on every page, which slows down the display speed, but this...

Continue reading

Code Web Without Plugin

CSS when long links overhang.You can also take measures on your mobile phone!

When viewed on a smartphone, long links may protrude horizontally.If this is the case, the following styles can be used to deal with the situation. a{word-break: break-all;}

Continue reading

Code Web Without Plugin Wordpress

Without Plugin!Easy copy and paste. how to add a site name shortcode to WordPress.

It is very time-consuming to rewrite site names when producing multiple sites. As a way of preventing this from happening, it is recommended to set up a system to call the name of the site by a shortcode. Write the...

Continue reading

Health

How to live longer.

1. Don’t Cigarette.2. Moderate exercise.3. Nutritious and balanced diet.4. Maintaining a healthy weight.5. Good quality sleep.6. Avoid stress.7. Conclusion. Don’t Cigarette. There are several best ways to live longer, but if asked to choose just one, ‘don’t smoke’, say researchers....

Continue reading

Plant Raise

The key points are sun, wind, water and soil! How to grow succulents.

Succulents are very easy to grow compared to other plants. There are four simple points. Maintain in a sunny location. Maintain in a well-ventilated area. Water when the soil is dry. Plant in well-drained soil. As long as the above...

Continue reading

Code Web Without Plugin

The one you write in wp-config.php for now.

define( 'WP_DEBUG', false ); ini_set('display_errors','Off'); define('ALLOW_UNFILTERED_UPLOADS', true); define('WP_MEMORY_LIMIT', '100000000000000000000M'); define( 'WPMS_ON', true );

Continue reading

Code Web Without Plugin Wordpress

Without plugins!Copy and paste, 3 minutes, super easy!How to implement dark mode.WordPress

Implement dark mode in WordPress.No plugin is required. 1. 1.JavaScript description.2. 2.Css description.3. 3.HTML description. 1.JavaScript description. Put the following js code in the header. document.addEventListener('DOMContentLoaded', function() { const toggleButtons = document.querySelectorAll('.toggle-mode'); toggleButtons.forEach(function(button) { button.addEventListener('click', function() { const currentMode =...

Continue reading

Plant

Cool and easy to grow Gymnocalycium Origin, origin and how to grow.

Gymnocalycium is one of the most robust species to manage. It is a cool and varied species with a very good balance of both ornamental and collecting value. 1. Origin2. Habitat3. Features4. Type5. Farming Origin Derived from the Greek ‘gymnòs’...

Continue reading

Plugin Security Web Wordpress

Change Table Prefix plugin for changing WordPress database prefixes (prefixes).

If you want to enhance the security of WordPress, you need to change the database table prefixes. If you want to make simple and quick changes after installation, this plugin is the one to choose. Change Table Prefix Light, fast...

Continue reading

Code Speed Web Without Plugin Wordpress

Without plugins!How to use syntax highlighting Prism.js.|WordPress

In this article, we will show you how to implement syntax highlighting in WordPress without using a plugin. Syntax highlighting is often used to display source code on websites and blog sites. This website has adopted “Prism.js” after various trials....

Continue reading

Leave a Reply

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.