# AutoUnzip

AutoUnzip unpacks a `.zip` file as soon as it has been uploaded into a watched folder. The sender uploads one zip; the folder ends up holding its files.

> [!NOTE]
> A server of version 27 built from the current sources comes with eleven plugins, and this one is not among them. Preferences still has its screen, which shows when the plugin's file is in the server's `plugins` folder, as it can be on a server that was upgraded from an earlier version, and where files that are not the server's own may be loaded: see [Writing a plugin](Plugins-Writing-Your-Own.md#getting-it-loaded). This page is written from that screen and the plugin's own help text; the plugin was not run.

## Settings

| Setting | Is |
|---|---|
| **Enabled**, **Debug** | as for every plugin: see [Plugins](Prefs-Plugins.md#a-plugin) |
| **Usernames to monitor** | the users it applies to, separated by commas |
| **List of FTP paths to watch and unzip uploads** | the folders, as the user sees them, ending in `/`: `/uploads/`. **Add Path**, **Edit Selected**, **Remove Selected**. |
| **Internal Unzipping** | the server unpacks the file itself |
| **Unzip into its own folder.** | the files go into a folder named after the zip, not straight into the upload folder |
| **External 'unzip' Unzipping** | the `unzip` command of the machine is used. For macOS, Linux and Unix. |
| **Delete original .zip** | the zip is removed once it is unpacked |

## The other way: a job

In version 27 the same is done, with more control, by a job that an upload [event](Users-Events.md) starts:

| Step | Task |
|---|---|
| take the uploaded file, if it ends in `.zip` | the event's own filter, or a [Branch](Task-Branch.md) |
| unpack it | [Unzip](Task-Unzip.md) |
| remove the zip | [Delete](Task-Delete.md) |
| tell somebody, or scan the files first | [Email](Task-Email.md), [Execute](Task-Execute.md) |

A job can also refuse a zip that holds the wrong files, and its runs are on record: [Running a job from an event](Users-Events-Plugin-Designer.md). Use the plugin where it is already in use; use a job for anything new.

## Things to know

- **A zip can be very large when unpacked.** Watch only folders of users you trust, or give them a [quota](Prefs-Quota.md).
- **Know what happens to names that exist.** Before relying on it, try what your version does when a zip holds a file whose name is already in the folder.
