PM Attachments - About

Started by admin, Aug 19, 2026, 03:02 PM

Previous topic - Next topic

admin

PM Attachments brings full file-attachment support to the SMF 2.1.7 Personal Message system.

It is designed to make PM attachments feel native to SMF rather than bolted on, while preserving the privacy and access rules that private messages already use.

The goal is simple:

Give private messages the same kind of attachment experience users already expect from forum posts.

Main Features:

  • Drag-and-drop PM attachment uploader
  • Multi-file uploads
  • Sequential upload handling for Chrome and Edge
  • Native-style attachment cards inside private messages
  • Image thumbnails
  • Secure attachment downloading
  • Configurable file limits
  • Configurable file-size limits
  • Configurable allowed extensions
  • Configurable thumbnail dimensions
  • Optional aspect-ratio preservation
  • Optional opening of attachments in a new tab/window
  • Automatic camera/iPhone image orientation correction
  • Pending-upload recovery after PM validation errors
  • Automatic attachment assignment when a PM is sent
  • Optional attachment deletion when a PM is permanently removed
  • Attachment Health & Maintenance Center
  • Orphan attachment detection and cleanup
  • Protection from SMF attachment-repair routines
  • PM Attachment Manager
  • Administrative PM Inspector
  • Search and filtering tools
  • SMF-style pagination
  • Safe administrative deletion
  • Alternate-theme Package Manager compatibility
  • Non-destructive uninstall
  • Native PM Attachment Workflow

PM Attachments integrates directly into SMF's normal Personal Message composer.

Members can add files while writing a PM using a drag-and-drop uploader rather than having to upload somewhere else and paste a link.

Multiple attachments can be queued and uploaded during the same message.

The uploaded files are temporarily held until the PM is successfully created, at which point PM Attachments adopts them and permanently associates them with that private message.

This keeps attachment ownership tied directly to the PM itself.

Drag-and-Drop Uploads

The uploader is designed to feel similar to SMF's normal attachment workflow.

Users can:

  • Drag files into the uploader
  • Select multiple files
  • See uploads handled individually
  • Continue composing while files are processed

Uploads are intentionally handled sequentially for improved compatibility with browsers such as Chrome and Edge.

Validation Error Recovery

A failed PM submission should not mean starting over with the attachments.

PM Attachments preserves pending uploads when SMF returns the user to the compose page because of a validation error.

That means something as simple as a missing recipient or another form error does not automatically force the member to upload all their files again.

Image Thumbnails

Image attachments can automatically receive thumbnails.

Administrators can configure:

  • Thumbnail generation on/off
  • Maximum thumbnail width
  • Maximum thumbnail height
  • Whether aspect ratio should be preserved

The thumbnail system uses SMF's attachment handling rather than maintaining a completely separate image store.

Camera & iPhone Image Orientation

One of the more useful image features in PM Attachments is automatic EXIF orientation correction.

Photos taken by phones and digital cameras often store their orientation in metadata rather than physically rotating the image pixels.

This can cause an uploaded picture to appear sideways or upside-down depending on where it is displayed.

PM Attachments can automatically normalize JPEG orientation before SMF creates the final attachment and thumbnail.

It supports ImageMagick when available and also contains its own JPEG EXIF-orientation handling with GD fallback.

The result is that the original image and its thumbnail should agree on the correct orientation.

Secure Downloads

PM attachments do not become public files simply because they are stored in SMF's attachment system.

Attachment downloads are routed through PM Attachments' own access checks.

Normal Personal Message permissions remain relevant to whether the requesting member can access the associated PM and its files.

Download counts are also maintained.

Configurable Upload Limits

Administrators can control PM attachment policy independently.

Available settings include:

  • Maximum attachments per PM
  • Set a specific number or use 0 for unlimited.
  • Maximum attachment size
  • Configured in KB and validated against the server's actual PHP upload limits.

Allowed extensions

A configurable comma-separated extension list.

The default package includes common formats such as:

  • jpg, jpeg, png, gif, webp, pdf, txt, zip

Attachment Display

Attachments are displayed inside private messages using native-style attachment presentation rather than raw file links.

Image attachments can show thumbnails while other file types remain available through attachment cards and filename links.

Administrators can also choose whether attachment links should open in the same browser window or a new tab/window.

Automatic Cleanup

PM Attachments can optionally delete associated files when a private message is permanently removed.

This includes attachment and thumbnail cleanup.

Administrators can disable this behavior if they prefer to retain the files.

Orphan Protection

Temporary uploads create an important maintenance problem: not every uploaded file necessarily becomes part of a completed PM.

PM Attachments handles that with an orphan safety window.

Fresh unassigned uploads are treated as potentially active and protected from cleanup.

Only attachments old enough to fall outside the configured safety period are presented as stale orphan candidates.

The default safety window is:

24 hours

Administrators can configure the period from 1 hour up to 30 days.

Safe Orphan Cleanup

Stale orphan attachments can be reviewed and removed through the administration interface.

Cleanup uses SMF's native attachment-removal handling rather than simply deleting database rows manually.

That means associated thumbnail files and attachment metadata follow SMF's normal cleanup path.

Recent uploads remain protected.

Health & Maintenance Center

PM Attachments includes its own administration health checks.

The system can inspect items such as:

  • Whether PM Attachments is enabled
  • Attachment-directory availability
  • Directory write permissions
  • Available disk space
  • PHP file-upload support
  • PHP upload limits
  • Configured PM attachment limit
  • GD/ImageMagick availability
  • Camera-orientation support
  • Allowed extension configuration
  • Required database columns
  • SMF attachment-repair protection
  • Stale orphan attachment status

The overall health state can identify a setup as:

  • Healthy
  • Degraded
  • Misconfigured

This makes attachment problems much easier to diagnose than waiting for members to report a failed upload.

Protection From SMF Attachment Repair

Because PM attachments live in SMF's native attachment table but are not attached to forum posts, they could otherwise look like attachments without messages.

PM Attachments integrates with SMF's attachment-repair process and protects legitimate PM-owned attachments from being incorrectly treated as abandoned files.

Fresh pending uploads inside the orphan grace period are protected as well.

PM Attachment Manager

Administrators get a dedicated PM Attachment Manager for inspecting attachment records.

Available views include:

  • Assigned
  • Attachments currently associated with private messages.
  • Unassigned / Orphans
  • Uploads that are not currently attached to a PM.
  • Missing / Broken
  • Attachment records where the expected file or thumbnail is missing.

The manager also provides search and filtering by information such as:

  • Attachment ID
  • PM ID
  • Filename
  • MIME type
  • Minimum size
  • Maximum size

Results use SMF-style pagination.

Safe Administrative Deletion

The manager allows attachments to be removed administratively, but assigned PM attachments require explicit confirmation.

This helps prevent a routine cleanup operation from accidentally destroying files still attached to live private messages.

Deletion is routed through SMF's native attachment-removal system.

Administrative PM Inspector

PM Attachments also includes an Administrative PM Inspector.

This allows a forum administrator to inspect the private message connected to a managed attachment when troubleshooting or maintaining the attachment system.

The inspector can show:

  • PM subject
  • Sender
  • Sent date
  • Recipients
  • Message body
  • Attached files

This tool is restricted to users with the admin_forum permission.

Importantly, administrative inspection does not change normal member access rules.

Inspector access is also recorded through the SMF administrative action log.

Database Integration

PM Attachments extends SMF's native attachments table with PM ownership information rather than introducing an entirely separate file-storage system.

The added PM ownership field allows an attachment to belong to a private message while continuing to use SMF's existing attachment engine, file hashes, folders, thumbnails, and removal routines.

Uninstall Policy

PM Attachments takes a deliberately conservative approach to uninstalling.

Uninstalling the MOD removes:

  • PM Attachments hooks
  • PM Attachments settings
  • Source files
  • Template files
  • CSS
  • Language files
  • Installed template modifications

However, uninstall does not automatically destroy historical attachment data.

The following are preserved:

  • Existing PM attachment database rows
  • PM ownership data
  • Attachment files
  • Thumbnail files

This is intentional.

A package uninstall should not silently delete files that may represent historical private-message data.

Destructive cleanup remains an explicit administrator decision.

Compatibility

PM Attachments: 1.0.0
SMF: 2.1.7

The package also contains direct upgrade coverage for the earlier RC development line through RC3d.

Default Configuration

The 1.0.0 package installs with practical defaults including:

  • PM Attachments enabled
  • Attachments open in a new tab/window
  • Camera image auto-orientation enabled
  • Maximum file size: 10 MB
  • Maximum files per PM: 5
  • Thumbnails enabled
  • Thumbnail size: 300 × 300
  • Aspect ratio preserved
  • Delete attachments with permanently deleted PMs enabled
  • Orphan safety window: 24 hours

Administrators can change these values from the PM Attachments configuration area.

Release Status

PM Attachments 1.0.0 is the first public release.

It brings together the full member upload workflow, secure PM ownership, image handling, thumbnail support, validation recovery, maintenance tools, repair protection, attachment management, administrative inspection, and non-destructive uninstall policy into one completed package.
Having trouble? Please contact me through Help & Support Board.