Magento 2 Experts — Hyvä Theme, Tailwind CSS & SEO from a Single Source ›

Magento 2 Contact Form Attachment: Secure File Upload

Magento 2 Extension Hyvä Ready Magento 2.4.x

SKU: CONTACTFORMATTACHMENT1

  • File upload in the contact form with type and size limits
  • Server-side MIME check, storage outside the web root
  • Virus scan hook for your own scanner
  • Automatic retention period for uploaded files
Auf Lager
€99.00

Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.

No download, but personal setup

No download, but personal setup. This product is not a downloadable software package for self-installation. With your order, you commission Mironsoft to individually set up this module in your shop. We will get in touch with you within 2 business days — we'll sort out the details and payment together then.

This offer is aimed at business owners and companies running a Magento 2 shop.

Magento 2 contact form attachment: why an upload is more than a field

A customer wants to send you a photo of a defective part, a prospect a technical drawing. The standard Magento contact form has no upload field for that. The Magento 2 contact form attachment module adds one and takes care of everything behind it: type and size validation, safe storage, notification and deletion.

A file upload is a classic attack surface. That is why the extension checks the file type on the server by content, stores files under random names outside the web root and offers a hook for your own virus scanner. The Magento 2 contact form attachment works in Hyvä shops with Alpine.js and without an additional script.

6 Features

Magento 2 contact form attachment: screenshot, photo or PDF without a security hole

Customers send photos of defects, delivery notes or drawings. The module accepts them safely and makes them available to your team.

Upload in the form

One or more files directly in the contact form, also on smartphones.

Type and size limits

Allowed extensions, maximum size and number per request are configurable.

Real validation

The file type is checked on the server by content, not just by extension.

Safe storage

Stored outside the web root, with randomly assigned file names.

Virus scan hook

An interface to plug in your scanner, flagged files are rejected.

Retention period

Files are removed automatically after a configurable time.

01Upload in the form

Magento 2 contact form attachment: only allowed files make it through

The upload field appears in the contact form and lists the chosen files with name and size. Type and size are pre-checked in the browser (Alpine.js, no extra script), but the binding check always happens on the server. Visitors get instant feedback, and tampered requests still run into a wall.

  • Allowed types such as PDF, JPG, PNG, DOCX are freely configurable
  • Maximum size per file and total number per request
  • Clear error messages in the language of the store view
Contact form · Attachments
Allowed: PDF, JPG, PNG · max. 5 MB · up to 3 files
delivery-note.pdf1.2 MB
defect-photo.jpg3.4 MB
archive.exerejected
Stores › Configuration › Contact Form Attachment
Storage path
var/contact_attachments (outside pub/)
Virus scan hook
Active, scanner: by arrangement
On detection
Reject upload and log
Admin access
only with permission from acl.xml
02Safe processing

Safe processing: files never end up unchecked in a public directory

Uploaded files are stored under random names outside the publicly reachable web root. Before saving, the module calls a virus scan hook: you can plug in your own scanner there, for example ClamAV. The module does not ship a scanner but the defined interface, and rejects files the scanner flags.

  • Random file names, no execution in the web root
  • Virus scan hook as an interface, scanner can be connected by arrangement
  • Rejected uploads are logged without storing the content
03Admin and privacy

Admin email, download link and retention for the contact form attachment

You choose whether the admin notification attaches the files directly or only contains a download link that requires an admin login. Large attachments then do not burden mailboxes. For GDPR you can show a privacy notice next to the upload field and set a retention period after which a cron job removes the files.

  • Email attachment or download link after login
  • Privacy notice text per store view
  • Cron job deletes files after the configured period
Admin email · New request
Sender
customer@example.com
Attachments
2 files, 4.6 MB in total
Access
Link after admin login
Deletion
automatically after 30 days

Use cases for the Magento 2 contact form attachment

Wherever customers want to include documents instead of sending them later by email.

Complaint with photo

Customers attach a picture of the damage. Your support sees the request and the photo together and does not have to ask again.

Spare part enquiry

Rating plate, drawing or invoice copy as PDF or image: fewer follow-up questions for technical products.

B2B quote request

Bills of materials or specifications can be uploaded directly with the enquiry.

Application or consultation

Service providers receive documents immediately. The retention period makes sure they do not stay around indefinitely.

Contact form without attachment versus Magento 2 contact form attachment

The difference shows in everyday support work.

AspectWithout moduleWith module
Sending files Only by reply email Directly in the form
Type check None Server-side by content (MIME type)
Storage Scattered across mailboxes Outside the web root, random names
Virus check Only in the mail system Hook for your scanner before saving
Privacy No retention period Automatic deletion after the configured period

Setting up the Magento 2 contact form attachment

  1. 1

    Clarify requirements

    Which file types, which sizes, which retention period? We agree on this with you.

  2. 2

    Installation

    We set up the upload field in the contact form and create the storage location outside the web root.

  3. 3

    Connect a scanner

    If you wish, we connect your virus scanner through the hook. A scanner is not part of the delivery.

  4. 4

    Test and approval

    We test allowed and rejected files and the admin email, then you enable the attachment.

Distinction from other Mironsoft modules

The Magento 2 contact form attachment only adds the file upload. Layout and additional form fields are handled by the existing contact form modules, attachments on orders by an order attachment module and attachments in transactional emails by another module. The extension can be combined with the contact form modules.

Merchants who use the Magento 2 contact form attachment keep their form as usual and only gain one additional, secured field. The Magento 2 contact form attachment stays optional per store view.

04How the purchase works

No download, but personal setup

Contact Form Attachment is not listed here as a ready-made download for self-installation. The purchase is a service order: after buying we contact you, set up the module and agree file types, sizes and the connection of a virus scanner together with you.

Important to know

Your purchase does not include a download link. We will get in touch with you within 2 business days — we'll sort out the details and payment together then. This offer is aimed at business owners and companies running a Magento 2 shop.

FAQ

Frequently asked questions

Answers to typical questions about the Magento 2 contact form attachment.

Does the module include a virus scanner?
No. It provides a hook through which you can connect your own scanner. We clarify which scanner makes sense during setup.
Is only the file extension checked?
No. The file type is checked on the server by content (MIME type). A renamed file is recognised and rejected.
Where are the files stored?
Outside the publicly reachable directory, under random file names. Access is only possible through the protected admin area.
How do I deal with GDPR?
You can show a privacy notice at the upload field and set a retention period. Please assess the legal side for your shop yourself or with your data protection advisor.
Does it work with my extended contact form?
Usually yes. The module only adds the upload field and can be used in addition to the Mironsoft contact form modules.
How can I add a file upload to the Magento 2 contact form?
With the Magento 2 contact form attachment module. It adds an upload field to the form and handles validation, storage and notification.
How can I limit file types and size for uploads in Magento 2?
In the configuration you set the allowed extensions, the maximum size per file and the maximum number per request. The limits apply per store view.
Does the Magento 2 contact form attachment work with Hyvä?
Yes. The upload field and file list use Alpine.js from the Hyvä standard, without additional JavaScript.
What happens to rejected files?
They are not stored, the visitor receives a clear error message, and the rejection is logged without the file content.
Can I download and install the module myself?
No. This offer is not a download product. After purchase we install and configure the module personally in your shop.
Write Your Own Review
You're reviewing: Magento 2 contact form attachment – Mironsoft
loader
Loading...

You submitted your review for moderation.

This form is protected by reCAPTCHA - the Google Privacy Policy and Terms of Service apply.

Magento 2 contact form attachment – Mironsoft

Magento 2 contact form attachment – Mironsoft

€99.00