Docs / Packages Management / File Attachments

File Attachments

Overview

File attachments are the downloadable files associated with a package. WPDM supports multiple files per package, various upload methods, and remote file hosting. This guide covers all aspects of attaching and managing files.

Prerequisites

  • WordPress Download Manager installed
  • Editor or Administrator user role
  • Files ready for upload
  • Adequate server storage space

Quick Start

  • Edit or create a package
  • Find the Attach File panel
  • Click Browse or drag files to upload
  • Files appear in the attached files list
  • Save the package

File Upload Methods

Browser Upload

The most common method:

  • Click the Browse button
  • Select one or more files from your computer
  • Wait for upload progress to complete
  • Files appear in the list below

Limitations:

  • Limited by PHP upload_max_filesize
  • May timeout for very large files
  • Depends on connection speed

Drag and Drop

Quick upload without clicking:

  • Open your file manager
  • Select files
  • Drag them onto the upload area
  • Drop when area highlights
  • Upload starts automatically

Server File Browser

For files already on the server:

  • Click Server File Browser
  • Navigate to file location
  • Select files to attach
  • Click Attach Selected

Benefits:

  • No upload time for existing files
  • Handles any file size
  • Works with pre-uploaded content

Default Locations:

  • /wp-content/uploads/
  • /wp-content/uploads/download-manager-files/

Remote URL

Attach files from external URLs:

  • Click Remote File or Add URL
  • Enter the direct file URL
  • Click Add

Supported:

  • Direct download links
  • CDN URLs
  • Cloud storage signed URLs
  • Any publicly accessible file

Note: File is not downloaded to your server. WPDM redirects users to the remote URL.

Cloud Storage Integration

With cloud storage add-ons:

Add-on Method
Amazon S3 Browse S3 buckets and attach
Google Drive Select from Drive files
Dropbox Choose from Dropbox
OneDrive Select from OneDrive

Managing Attached Files

File List View

The attached files panel shows:

Column Description
Icon File type icon
Name File name (editable)
Size File size
Actions Edit, Delete buttons
Handle Drag handle for reordering

Reordering Files

To change file order:

  • Hover over a file
  • Grab the drag handle (⋮⋮)
  • Drag to new position
  • Release

Order affects:

  • ZIP file structure
  • File list display in templates
  • Single file download order

Renaming Files

To rename a file’s display name:

  • Click the file name or edit button
  • Enter new name
  • Save the package

Note: This changes the display name, not the actual filename on disk.

Removing Files

To detach a file:

  • Click the delete (X) button
  • Confirm if prompted
  • Save the package

Options:

  • Detach only: File remains on server
  • Delete permanently: File removed from server

Replacing Files

To update a file while keeping download counts:

  • Remove the old file
  • Upload the new version
  • Save the package

For versioning, use the Version tab instead.

File Information

Automatic Detection

WPDM automatically detects:

  • File size
  • MIME type
  • File extension
  • Icon assignment

Manual Override

Override auto-detected info in file settings:

  • Custom display name
  • Custom file size display
  • Custom icon

Multiple Files

ZIP Archive Behavior

When a package has multiple files:

Default behavior:

  • All files bundled into ZIP
  • Single download button
  • ZIP created on-the-fly or cached

Alternative (Single File Download):

  • Enable in Package Settings
  • Each file gets its own button
  • Users download individually

ZIP Options

Configure ZIP behavior at Downloads > Settings > General:

Option Description
Cache ZIPs Pre-generate and cache ZIP files
Compression Level Speed vs. size tradeoff
Include Folder Wrap files in package folder

Supported File Types

Default Allowed Types

All WordPress media types plus:

  • Archives: zip, rar, 7z, tar, gz
  • Documents: pdf, doc, docx, xls, xlsx, ppt, pptx
  • Executables: exe, msi, dmg, app (if enabled)
  • Code: php, js, css, html (if enabled)

Adding Custom Types

Add allowed MIME types at Downloads > Settings > General:

application/x-custom-type

Or use filter:

add_filter('wpdm_allowed_mime_types', function($types) {
    $types['custom'] = 'application/x-custom-type';
    return $types;
});

Blocked Types

By default, these are blocked:

  • PHP files (security)
  • Executable scripts
  • System files

To allow (use caution):

add_filter('wpdm_blocked_extensions', function($blocked) {
    $key = array_search('php', $blocked);
    if ($key !== false) unset($blocked[$key]);
    return $blocked;
});

File Storage

Default Location

Files are stored in:

/wp-content/uploads/download-manager-files/

Changing Storage Location

In Downloads > Settings > General:

  • Set Files Directory path
  • Ensure directory exists and is writable
  • Existing files remain in old location

File Organization

Files are organized by:

  • Year/month folders (optional)
  • Package ID folders (optional)
  • Flat structure (optional)

Storage Security

WPDM protects files via:

  • Directory index disabled
  • .htaccess rules (Apache)
  • Direct access blocking
  • Token-based downloads

Large File Handling

Upload Large Files

For files larger than PHP limits:

  • Increase PHP limits:
   upload_max_filesize = 512M
   post_max_size = 512M
   max_execution_time = 600
   
  • Use FTP upload:

– Upload via FTP/SFTP
– Use Server File Browser to attach

  • Use chunked upload add-on:

– Splits large files
– Resumes interrupted uploads

Download Large Files

WPDM handles large downloads with:

  • Chunked file serving
  • Resume support (partial downloads)
  • Stream-based delivery
  • Memory-efficient processing

Remote Files

Direct URL Files

Add URLs to files hosted elsewhere:

https://cdn.example.com/files/software-v2.zip

WPDM will:

  • Redirect users to the URL
  • Track downloads (if trackable)
  • Display file info from headers

CDN Integration

For CDN-hosted files:

  • Upload files to CDN
  • Add CDN URL as remote file
  • WPDM redirects to CDN for downloads

Benefits:

  • Faster downloads globally
  • Reduced server load
  • Bandwidth savings

Cloud Storage URLs

With cloud add-ons, you can:

  • Browse cloud files
  • Generate signed URLs
  • Serve files from cloud directly
  • Sync local ↔ cloud

File Security

Access Control

Files inherit package access settings:

  • Role requirements
  • Lock requirements
  • User-specific access

Hotlink Protection

Prevent direct file linking:

  • Enable at Downloads > Settings > Security
  • Or use Block Hotlink add-on
  • Only downloads through WPDM allowed

File Encryption

For sensitive files:

  • Use password locks
  • Consider encrypted storage add-ons
  • Implement watermarking (PDF Stamper add-on)

Troubleshooting

Upload Fails

Cause: File too large

Solution:

  • Increase PHP limits
  • Use FTP upload
  • Use chunked upload

Cause: File type not allowed

Solution:

  • Add MIME type to allowed list
  • Check blocked extensions

File Not Found

Cause: File deleted from server

Solution:

  • Re-upload the file
  • Check file path in database
  • Verify storage directory exists

Download Returns Wrong File

Cause: File ID mismatch or cache issue

Solution:

  • Re-attach the correct file
  • Clear any caching
  • Check for duplicate file names

Slow Downloads

Cause: Large file or server limitation

Solution:

  • Enable CDN
  • Use cloud storage
  • Increase PHP memory/time limits
  • Enable download chunking

ZIP Creation Fails

Cause: Memory limit or disk space

Solution:

  • Increase PHP memory limit
  • Clear disk space
  • Enable ZIP caching
  • Reduce compression level

Best Practices

File Naming

  • Use descriptive names
  • Avoid special characters
  • Include version numbers
  • Keep names reasonably short

File Organization

  • Group related files in same package
  • Use categories for different types
  • Consider separate packages for different versions

Performance

  • Use CDN for popular files
  • Enable ZIP caching
  • Use cloud storage for large libraries
  • Monitor disk space usage

Related Documentation


Last updated: January 2026
Applies to: WordPress Download Manager 7.x

Last updated on January 26, 2026

Need Help?

Get support from our team or community forum.

Visit Support

Customization

Need custom features? We can help.

Request Quote