Attachments
Customers and staff can attach images to a ticket — JPEG, PNG and WebP, several at a time. A screenshot usually settles a support question faster than three rounds of email, so the file inputs are on the submit form, on the customer's reply form, and on the reply composer here in the control panel.
What is accepted
Wrangler decides what a file is by reading its header, not by trusting its name or the content
type the browser sent. A PHP script renamed screenshot.png is refused, and so is a PDF, a zip
and a video. Only real JPEG, PNG and WebP images are stored.
Anything rejected is reported to the person who uploaded it, by name, saying why. The ticket or reply itself is still saved — a bad file never costs someone their support request.
Where the files go
Not in an upload directory. A support desk collects screenshots of invoices, account pages and error dialogs, and an EE upload destination is served straight off disk with no access check at all — any leaked URL would be the file.
Instead the bytes live in a private directory, named only by 256 bits of randomness, and reach a browser through one endpoint that refuses anything without a valid, expiring signature.
| Setting | Default | What it does |
|---|---|---|
| Allow image attachments | On | Turn off to hide the file inputs and stop new uploads. Images already attached stay on their tickets. |
| Maximum size per image | 5 MB | PHP's own upload_max_filesize and post_max_size still apply. If either is lower, that is the real limit. |
| Maximum images per message | 5 | Anything beyond this on one submission is dropped, and the uploader is told. |
| Storage directory | system/user/wrangler-files/ |
Absolute server path. Put this above your webroot if you can. |
About the storage directory
Wrangler writes an .htaccess deny rule into the directory when it creates it. Apache honours
it; nginx ignores it entirely. That is why the protection does not rest on it:
- Filenames are 256 bits of
random_bytes, with no image extension. They are not derivable from the ticket, the message, or the customer's own filename. - The filename never leaves the server. A signed image URL names the attachment by its row id, so someone who was legitimately shown an image cannot read a permanent filesystem path out of the URL and keep fetching it after the link expires.
- Every image URL expires six hours after the page that produced it was rendered.
The settings screen tells you when the directory resolves inside your webroot. That is a nudge rather than an error — it is safe as it stands — but a directory above the webroot removes the question, and it is one line of configuration to move it.
Internal notes
An image attached to an internal note is as private as the note. It is excluded from the customer's thread by the same database query that hides the note text, so it cannot reach the rendered page even if a template does something unexpected with the data.
Notifications never carry the image files. They link back to the ticket, which keeps messages small, keeps deliverability high — Wrangler already sends two messages per submission — and keeps the images behind the access check instead of loose in an inbox.
Templates
Inside {messages}, each message exposes its own images:
{messages}
<div>{message}</div>
{if has_attachments}
<div class="wr-msg__files">
{attachments}
<a href="{attachment_url}" target="_blank" rel="noopener">
<img src="{attachment_url}" alt="{file_name}" loading="lazy">
<span>{file_name} · {file_size}</span>
</a>
{/attachments}
</div>
{/if}
{/messages}
| Variable | Value |
|---|---|
{attachment_url} |
Signed, expiring URL for the image. Use it for both src and href. |
{file_name} |
The uploader's own filename, escaped. |
{file_size} |
Human readable, e.g. 412 KB. |
{width} / {height} |
Pixel dimensions. |
{if has_attachments} / {attachment_count} |
Per message, and also available at the top level for the whole thread. |
To accept uploads, add a file input to the submit or reply form. The tag already makes the form
multipart/form-data, so nothing else is needed:
<input type="file" name="attachments[]" multiple accept="image/jpeg,image/png,image/webp">
The [] on the name is what allows more than one file.
Uninstalling
Removing Wrangler drops its tables but leaves the attachment files on disk. Tables come back from a database backup; a support desk's screenshots do not, and an uninstall is more often a step in moving a site than the end of one. Delete the storage directory by hand when you are sure.