Skip to main content

Multiple file downloads

How Multiple File Downloads Work

When a product has multiple downloadable files, Free Downloads for WooCommerce offers several display options to give customers flexibility in how they download files.

For products with 2 or more downloadable files, the plugin can:

  1. Show individual download links for each file
  2. Create a ZIP file containing all files
  3. Let customers select which files to include in a ZIP
  4. Combine multiple display methods

The ZIP creation happens automatically on-demand and files are cleaned up hourly to save server space.

Placeholder: Screenshot of multiple file download options

Display Methods

Choose how multiple files are presented to customers.

Shows individual download links for each file.

Advantages:

  • Customers can choose which files to download
  • No ZIP creation needed
  • Fast and simple
  • Good for small files

Best for:

  • Products with 2-5 files
  • When customers typically want specific files
  • When files are small and quick to download

Placeholder: Screenshot of links only display

Configuration:

  1. Go to WP Enhanced > Free Download Woo, then click Multiple Files in the sidebar
  2. Set Display method to Links Only
  3. Save changes

Button Only

Shows a single "Download All (.ZIP)" button that creates a ZIP with all files.

Advantages:

  • One-click download of everything
  • Clean, simple interface
  • Good for related files that should be downloaded together

Best for:

  • Products with many files
  • When customers typically want all files
  • Course materials, resource packs, template bundles

Configuration:

  1. Go to WP Enhanced > Free Download Woo, then click Multiple Files in the sidebar
  2. Set Display method to Button Only
  3. Customize Button text (default: "Download All (.ZIP)")
  4. Save changes

Button + Checkboxes

Shows checkboxes for each file with a button to download selected files as a ZIP.

Advantages:

  • Maximum flexibility for customers
  • Customers choose exactly what they want
  • Reduces unnecessary downloads

Best for:

  • Large file collections
  • When customers may only want some files
  • Resource libraries with optional content

Configuration:

  1. Go to WP Enhanced > Free Download Woo, then click Multiple Files in the sidebar
  2. Set Display method to Button + Checkboxes
  3. Customize Button text
  4. Save changes

How it works:

  • All checkboxes are checked by default
  • Customers uncheck files they don't want
  • Clicking the button creates a ZIP with only selected files
  • At least one file must be selected

Shows both individual download links AND a "Download All" button.

Advantages:

  • Offers both options to customers
  • Flexibility without complexity
  • Good middle ground

Best for:

  • Mixed use cases
  • When some customers want everything, others want specific files
  • Professional resource downloads

Configuration:

  1. Go to WP Enhanced > Free Download Woo, then click Multiple Files in the sidebar
  2. Set Display method to Button + Links
  3. Save changes

Button + Filenames

Shows a list of filenames with a "Download All" button.

Advantages:

  • Shows what's included without clickable links
  • Clean, informative display
  • Encourages downloading everything

Best for:

  • When you want to show contents but encourage bulk download
  • Professional presentations
  • Course material packages

Configuration:

  1. Go to WP Enhanced > Free Download Woo, then click Multiple Files in the sidebar
  2. Set Display method to Button + Filenames
  3. Save changes

Customizing Button Text

Customize the "Download All" button text to match your use case.

Examples of Custom Button Text

  • "Download Complete Package (.ZIP)" - For comprehensive bundles
  • "Get All Files (.ZIP)" - Simple and clear
  • "Download Course Materials (.ZIP)" - For educational content
  • "Get Template Bundle (.ZIP)" - For design resources
  • "Download Selected Files (.ZIP)" - For checkbox method

How to Change Button Text

  1. Go to WP Enhanced > Free Download Woo, then click Multiple Files in the sidebar
  2. Find Button text field
  3. Enter your custom text
  4. Save changes
tip

Include "(.ZIP)" in the button text so customers know they're downloading an archive file.

ZIP File Creation

When customers download multiple files, the plugin automatically creates a ZIP archive.

How ZIP Creation Works

  1. Customer clicks "Download All" or "Download Selected"
  2. Plugin validates all files are accessible
  3. ZIP file is created on-demand in /wp-content/uploads/somdn-zips/
  4. ZIP is downloaded to customer's device
  5. ZIP files are automatically deleted after 1 hour

ZIP File Naming

ZIP files are automatically named based on the product:

Format: product-slug-timestamp.zip

Example: free-ebook-bundle-1699564832.zip

The timestamp ensures unique filenames and prevents caching issues.

ZIP File Cleanup

To prevent server storage issues:

  • ZIP files are stored temporarily in /wp-content/uploads/somdn-zips/
  • Files older than 1 hour are automatically deleted
  • Cleanup runs via WordPress cron (hourly)
  • Manual cleanup: Delete files in the somdn-zips folder
info

If your server has limited disk space and you offer large file downloads, monitor the somdn-zips folder to ensure cleanup is working properly.

File Limitations

File Size Considerations

Individual Files:

  • No plugin-imposed limit
  • Limited by your server's PHP settings
  • Check upload_max_filesize and post_max_size in php.ini

ZIP Files:

  • Total size limited by PHP memory limit
  • Large ZIPs (>100MB) may timeout on some servers
  • Consider server resources when offering large file collections

File Count

  • No limit on number of files per product
  • More files = longer ZIP creation time
  • Consider user experience with many files (10+ files)

File Types

All file types are supported:

  • Documents (PDF, DOC, DOCX)
  • Images (JPG, PNG, GIF, SVG)
  • Archives (ZIP, RAR, 7Z)
  • Media (MP3, MP4, AVI)
  • Code (PHP, JS, CSS)
  • Any other file type
External URLs

ZIP creation works best with files hosted on your server. External URLs may have limitations or fail to include in ZIP files.

Multiple Files on Shop Pages

On shop and archive pages, products with multiple files always show a "Read More" button, even if direct downloads are enabled for single files.

Why?

  • Prevents cluttering shop pages with multiple links
  • Maintains clean, consistent shop page layout
  • Encourages customers to visit product page for details

Customize the text:

  1. Go to WP Enhanced > Free Download Woo, then click General in the sidebar
  2. Find Read More text field
  3. Enter custom text (e.g., "View Files", "See Downloads")
  4. Save changes

Styling Multiple File Downloads

Customize the appearance of individual file links:

  1. Go to WP Enhanced > Free Download Woo, then click General in the sidebar
  2. Find Link classes field
  3. Add custom CSS classes
  4. Or use Link CSS for inline styles
  5. Save changes

Default class: somdn-download-link

Button Styling

Customize the "Download All" button:

  1. Go to WP Enhanced > Free Download Woo, then click General in the sidebar
  2. Find Button classes field
  3. Add custom CSS classes
  4. Or use Button CSS for inline styles
  5. Save changes

Default classes: somdn-download-button single_add_to_cart_button button

Custom CSS Examples

Styled Links:

/* Add to Link CSS field */
color: #0073aa;
font-weight: 600;
text-decoration: none;
padding: 5px 10px;
border-left: 3px solid #0073aa;
display: inline-block;
margin: 5px 0;

Styled Button:

/* Add to Button CSS field */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 15px 30px;
border-radius: 8px;
font-weight: bold;

Integration with Other Features

PDF Viewer

If any file is a PDF and PDF Viewer is enabled:

  • Individual PDF links show "View PDF" option
  • "Download All" button still creates ZIP with all files
  • See PDF Viewer for details

Login Requirements

When login is required:

  • All download links and buttons require login
  • Logged-out users see login message
  • See Login Requirements for details

WooCommerce Memberships

Restrict multiple file downloads to members:

  • All files respect membership requirements
  • Non-members see membership message
  • See WooCommerce Memberships for details

Troubleshooting Multiple File Downloads

ZIP Creation Fails

If ZIP download doesn't work:

  1. ✅ Check PHP ZipArchive extension is installed
  2. ✅ Verify /wp-content/uploads/ is writable
  3. ✅ Check PHP memory limit (increase if needed)
  4. ✅ Verify all file URLs are accessible
  5. ✅ Check for PHP errors in error log

Some Files Missing from ZIP

If not all files are included:

  1. ✅ Verify all file URLs are correct
  2. ✅ Check files exist on server
  3. ✅ Ensure files are readable (check permissions)
  4. ✅ Look for external URLs (may not work with ZIP)
  5. ✅ Check PHP error log for specific errors

ZIP Download is Slow

If ZIP creation takes too long:

  1. ✅ Check total file size (large files take time)
  2. ✅ Increase PHP max_execution_time
  3. ✅ Increase PHP memory_limit
  4. ✅ Consider hosting large files on CDN
  5. ✅ Reduce number of files per product

Checkboxes Not Working

If checkbox selection doesn't work:

  1. ✅ Check for JavaScript errors in browser console
  2. ✅ Verify jQuery is loaded
  3. ✅ Check for plugin conflicts
  4. ✅ Try disabling other plugins temporarily
  5. ✅ Clear browser cache

Best Practices

File Organization

  • Group related files: Put similar files in the same product
  • Logical naming: Use clear, descriptive filenames
  • Consistent naming: Follow a naming convention across products
  • Order matters: Files appear in the order you add them

Display Method Selection

  • 2-3 files: Links Only works well
  • 4-6 files: Button + Links offers flexibility
  • 7+ files: Button Only or Button + Checkboxes
  • Mixed sizes: Button + Checkboxes lets customers avoid large files

User Experience

  • Describe contents: Use product description to explain what files are included
  • Show file sizes: Mention if files are large
  • Provide previews: Use product images to show what's inside
  • Test downloads: Always test as a customer would

Performance

  • Monitor disk space: Check the somdn-zips folder regularly
  • Optimize file sizes: Compress files before uploading
  • Consider CDN: For very large files, use a CDN
  • Set appropriate limits: Don't offer too many large files in one product

What's Next