Unzip ZIP files in media library

Logo of the plugin External files in the media library
Table of Contents

The „External files in the media library“ plugin also allows ZIP files to be unpacked into the media library. The files from the ZIP file are inserted into the media library as normal files.

There are various ways to achieve this. Choose the one that suits you best from the options below.

Prerequisites

The only requirement for all of these ways is that your hosting has the PHPPHP PHP is a scripting language with a syntax based on C and Perl, which is mainly used to create dynamic websites or web applications. https://de.wikipedia.org/wiki/PHP Module ZipArchive must be activated. If it is not, the options mentioned here will not be available to you and you may also receive a message about this. In this case, please contact your hoster's support.

Extract all files from a ZIP file that is already in the media library

  1. Call up the media library as usual in the backend.
  2. Search there for the ZIP file you have already uploaded.
  3. Click on the „Unpack“ link.
  4. The Dialog will ask you what exactly should be done with the files. Decide and confirm.
  5. All files from the ZIP file are then unpacked into the media library.

Open a ZIP file that is already in the media library and unzip the files in it individually

  1. Call up the media library as usual in the backend.
  2. Search there for the ZIP file you have already uploaded.
  3. Click on the „Open“ link.
  4. The file will now be opened. Wait a moment until the process is finished.
  5. You will now see a list of directories and files in front of you. Select the files you want to import and click on the corresponding button.

Open a ZIP file that is located somewhere else

Prerequisites

  • The file must be accessible from within WordPress, i.e. either via HTTPHTTP Hypertext Transfer Protocol, HTTPSHTTPS Hypertext Transfer Protocol Secure or FILE.
  • The URL of the file must be set to .zip end.
  • You need to know their URL.

Procedure

  1. In the WordPress backend, go to Media library > Add external files > ZIP.
  2. Enter the known URL of the ZIP file in the field and submit the form.
  3. You will now see a list of directories and files in front of you. Select the files you want to import and click on the corresponding button.

Examples of URLs that can be used here

file:///var/www/vhosts/example.com/httpdocs/example.zip
https://example.com/example.zip

Notes

  • When unpacking files from a ZIP, no attention is paid to their directories. These are not created in the media library, as it does not (currently) support this. The plugin does not currently offer any support for third-party plugins that provide such directory structures.
  • If the ZIP is in an access-protected source (e.g. only via FTPFTP File Transfer Protocol is accessible), then I would recommend first importing them from there into the media library and then opening or unpacking them in the media library (as described above).
  • The amount of data when unpacking is limited by the resources in your hosting.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Question not answered?