# Extract ZIP Files into the Media Library

The "External Files in the Media Library" plugin also allows you to extract ZIP files into the media library. The files from the ZIP file are added to the media library as regular files.

There are several ways to do this. Choose the one that works best for you from the options below.

## Prerequisites

The only prerequisite for all of these methods is that the *ZipArchive* PHP module must be enabled on your hosting server. If it isn’t, the options listed here will not be available to you, and you may see a message to that effect. In that case, contact your hosting provider’s support team.

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

1. Open the Media Library in the backend as usual.
2. Search for the ZIP file you’ve already uploaded.
3. Click the "Extract" link next to it.
4. The [dialog](https://plugins.thomaszwirner.de/externe-dateien-in-der-mediathek/der-import-dialog/) will ask you exactly what you want to do with the files. Make your selection and confirm.
5. All files from the ZIP file will then be extracted into the media library.

## Open a ZIP file that’s already in the media library and extract the files inside one by one

1. Access the media library in the backend as usual.
2. Search for the ZIP file you’ve already uploaded.
3. Click the "Open" link next to it.
4. The file will now open. Wait a moment until the process is complete.
5. You’ll now see a list of directories and files. Select the files you want to import and click the corresponding button.

## Opening a ZIP File Located Elsewhere

### Prerequisites

- The file must be accessible from within WordPress, i.e., via HTTP, HTTPS, or FILE.
- The file’s URL must end with `.zip`.
- You must know the file’s URL.

### Procedure

1. In the WordPress dashboard, go to Media &gt; Add External Files &gt; ZIP.
2. Enter the URL of the ZIP file you know in the field and submit the form.
3. You will now see a list of directories and files. Select the files you want to import and click the corresponding button for each one.

### Examples of URLs that can be used here

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

## Notes

- When extracting files from a ZIP file, their directory structures are not preserved. These directories are not created in the Media Library, as it does not (currently) support this feature. The plugin also does not currently offer support for third-party plugins that provide such directory structures.
- If the ZIP file is located in a restricted-access source (e.g., accessible only via FTP), I would recommend first importing it from there into the media library and then opening or extracting it within the media library (as described above).
- The amount of data that can be extracted is limited by the resources available on your hosting account.