Bulk download selected media or attachment files from your Media Library as a zip file.

(Also available on Github.)

Description

A ‘Download’ option is added to the ‘Bulk Actions’ dropdown in the Media Library. Choose the attachments you want to export, click ‘Apply’, and a zip file of those attachments is created that you can then download.

Before the zip file is created, you’ll see a) how many files will be downloaded, and b) how big the uncompressed files are. By default, you are also given the option to:

  • Include or exclude image intermediate sizes.
  • Include in your download the folder structure you use in your uploads folder (e.g. year/month) or have all files downloaded in a single folder.

You can set a maximum (uncompressed) file size to be downloaded in the plugin settings, found in Settings > Media.

By default, zip files are automatically removed in 1 – 2 hours, or you can delete them yourself.

If you want to keep the download files inaccessible to others, you can use the ‘Make downloads secure’ option in Settings > Media. This creates a .htaccess file in the folder where the download zip files are kept, preventing direct access.

You can also choose to encrypt and password-protect the zip files. However please note that in most cases the standard Windows zip facility will not be able to open the files – you will need to use something like 7-Zip instead.

However there’s no point in using this feature or the .htaccess one unless you also have some means of preventing direct access to the attachments
themselves in the Uploads folder.

If you have any questions, do please get in touch using the comments or the contact form.

FAQ

Where do I find my downloads?

Click on ‘Bulk downloads’ under ‘Media’.

How can I increase the number of attachments I can download in one go?

To increase the number of attachments you can see on the screen at once, click on ‘Screen Options’ at the top right of the Media Library, and increase the ‘Number of items per page’.

What’s the maximum number of attachments I can download at once?

It depends. The theoretical absolute maximum is 999. That’s the maximum you can set for ‘Number of items per page’ in the Media Library (see above). But there may be other constraints depending on your host setup, such as max script execution time, file size limits and memory limits. Whether you reach those constraints will depend on the number and size of files you are trying to download in one go. If you see error messages or your zip file is incomplete or corrupted, try several smaller downloads instead of one big one.

How long does it take for the zip file to be created?

That depends on the number and size of files you are downloading, and also on your host setup. Try downloading smaller numbers of files to get a feel for how long it takes before attempting a large download.

Who can create downloads?

Permissions are set so that:

  • Anyone who has the capability ‘upload_files’ can create downloads.
  • A user can download an attachment if that user has permission to edit the attachment.
  • Only users who have the capability ‘manage_options’ can download, edit, or delete a download that another user has created.

That means that if the WordPress default roles and capabilities are being used:

  • Administrators and editors can download any attachments.
  • Authors and contributors can download only those attachments they uploaded.
  • Only administrators can download, edit or delete a download created by another user.

Why can’t I open the password-protected zip files?

Probably because you are using the standard Windows zip facility, which will not work. Try 7-Zip instead.

What filters are available?

  • jabd_max_files_size. Max download file size limit is set in the plugin settings in Settings > Media, but if you wanted to set the file size per user you could use this filter.

Screenshots

Screenshot 1    Screenshot 2

Leave a Reply

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