WordPress provides a function called unzip_file()
— easily found by typing “wordpress unzip” into Google. There is sample code in the Codex:
WP_Filesystem();
$destination = wp_upload_dir();
$destination_path = $destination['path'];
$unzipfile = unzip_file( $destination_path.'/filename.zip', $destination_path);
if ( $unzipfile ) {
echo 'Successfully unzipped the file!';
} else {
echo 'There was an error unzipping the file.';
}
I have no idea what “custom work” you need to do.
Related Posts:
- Redirect to another page using contact form 7? [closed]
- How to save WordPress post and attachment images from front end using media library?
- How to register images uploaded via FTP in media library?
- How to use copy() function and paste file in /wp-content/themes directory
- Image upload via FTP to wordpress media library
- WordPress media upload “HTTP error”
- do not show web page section when using advanced custom fields pro
- Am I not understanding plugins?
- Adding a querystring to an image URL when clicking ‘insert into post’?
- Using Font Awesome as post thumbnail
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- custom shortcode will not display the wrapped content
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- How can i upload images in an admin page?
- Hide categories that are not used in the post type
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- what is the best practice to add new field to an api route
- How to upload a file to a folder named after the user_id via plugin
- add custom link to wordpress media gallery modal
- Improve page speed loading using CDN and async or defer attribute
- Can’t upload image using media_sideload_image
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to add the sidebar to all the pages except the home page? [closed]
- Can’t upload CSV file to plugin directory using custom upload form in admin panel
- Validate and Sanitize WP REST API Request using WP JSON Schema?
- How can I search all plugins for composer’s vendor/autoload.php?
- custom plugin with upload files does not work
- Removed jQuery script from header.php , any problems?
- Toolbar Hidden in a Virtual Page
- Change image data durgin upload
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- How to extend SelectControl with data from my theme
- How to change basename url for wp-admin?
- Submit remote form to wordpress REST API and save data to custom post type
- Store user form submitted information in post type
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Add a custom link to each image in WordPress gallery
- register dependency css and js inside a plugin class
- How to properly escape in ternary operators – Wp Coding Standards?
- Upload images from one server to an other in wordpress
- How to destroy or dispose wordpress uploder/manager?
- Renaming “Expand Details” within “Add Media”
- Save the outputted image into the Media Library, with a different filename and extension
- WP multisite network plugin fails to see classes loaded with spl autoload
- Edit Image/Image Details – Replace button missing
- How to edit the default database of WordPress [closed]
- How to automatically convert images to WebP on WordPress?
- Variable ++ in query loop
- Woocommerce Convert existing order to the cart
- Capture the Selected Radio Button Value between two files in wordpress theme
- Changing upload directory temporarily
- 404 error on page reload
- plugin add action hook is not working :
- How to call multiple functions from multiple files into a WordPress page template [closed]
- Theme’s Options Page included with require_once *.php in functions.php not visible anymore
- wp_insert_post: array only. wp_update_post: array|object (?)
- Using data sent via AJAX in multiple functions on a WP plugin
- Problem with AJAX in wordpress plugin
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Is it save to use eval for a jQuery callback method coming from the database?
- What does -> mean in WordPress?
- Get title attribute from galleries
- How to show an entire post content and not also the excerpt?
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- WordPress import media error
- Why in my theme I can’t see all the statics content under the posts?
- get_template_directory adding FTP root folders in urls
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- wpdb prepare insert table doesn’t work
- Theme not calling Jquery properly
- Getting a WordPress Debug Strategy
- How can I use a sliced image As banner? [closed]
- wordpress admin plugin menu custom css
- Usage of call back function of add_meta_box()
- Building a REST API for your web app exposes primary keys of DB records?
- WordPress get_media_embedded
- Change product_base programmatically
- Hide Heading if ACF Field is empty
- Scheduling an event inside plugin class is not working
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- What is the best way to define constant options for a theme?
- Header not properly displaying on archive.php
- Custom meta box values are not getting saved for my custom post type
- How do I get the content excerpt of the recent post?
- Save Custom CSS file in the upload folder dynamically?
- How to remap one of the TinyMCE Advanced Editor button to open the wordpress media library?
- wp.media issue with selected image
- how to save checkbox data for custom setting?
- Upload multiple files in randomly generated folder using wp_upload_bits
- How to Change CSS Colors from Custom Plugin Settings Page
- WordPress shortcode returns the data before
- Passing the name of selected color from the custom component to `render_callback`
- Live to Local on MAMP, not working, outputting functions.php code
- How to specify the path for require_once in a child theme?
- Warning: printf(): Too few arguments in helpers.php file
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Can a plugin redirect product page based on IF condition?