This is the complete documentation for STM Product Attachments (version 2.1.0), listed on the Adobe Commerce Marketplace as Product Attachments & Downloads. Everything on this page is free to read — no registration, no account.
User Guide
Overview
STM Product Attachments adds a dedicated attachments tab to every product on your Magento 2 / Adobe Commerce store. Shop owners can upload files on the product edit page, mass-assign from the product grid, bulk-import via CSV or let a rule engine attach files automatically. Customers see an Attachments tab on the product page with thumbnails, colour-coded file-type badges, file size, download counter and an inline preview modal that supports PDFs, Word, Excel, PowerPoint, plain text, CSV, images, YouTube and direct video files — all rendered server-side, with no external viewer or third-party CDN dependency. The extension is configuration-driven, translatable and compatible with Luma-based themes. All admin settings are scope-aware down to the store-view level.
Adding Attachments on a Product
Open any product under Catalog > Products. A new Product Attachments collapsible block appears on the product edit page. Click Add Attachment, upload a file (or paste a YouTube URL), enter a title, optionally assign a category and set the sort order. Save the product.
Central Attachment Management
All attachments across all products are available as a grid under Catalog > Product Attachments > Manage Attachments. The grid supports column filters, full-text search and pagination. Mass actions include Mass Delete and Mass Category Assign.


Mass Assign from the Product Grid
Select any number of products in Catalog > Products, open the Actions dropdown and choose Assign Attachment. The form that opens has a drag-and-drop file dropzone and captures title and sort order. On submit, the same file is attached to all selected products in a single batch — useful for product documents that apply to a whole brand, collection or safety class.

file to all of them in a single batch.
CSV Import
For larger rollouts, use Catalog > Product Attachments > Import Attachments. Prepare a CSV with the columns sku, title, file_path (required) and category, sort_order (optional), upload your attachment files to pub/media/import/attachments/, then pick the CSV and click Import. Validation errors are reported per row.

Attachment Categories
Attachment categories organise your documents (Manuals, Data Sheets, Certificates, Safety Information …) and drive the grouping on the product detail page when Group by Category is enabled. Manage them in the Attachment Categories section of the system configuration.

Auto-Assign Rules
For repetitive assignments at scale, use the rule engine under Catalog > Product Attachments > Auto-Assign Rules. A rule defines one file plus a set of conditions on product category, attribute set or any product attribute. Conditions combine via AND or OR. Each rule can be applied on save, run nightly via cron, or triggered manually from the grid. After apply, the Full Page Cache is flushed automatically so the storefront reflects the change immediately.

Storefront Experience
On the product detail page, attachments appear in a new Attachments tab alongside Description and Reviews. Each row shows a thumbnail or colour-coded file-type badge, the title, file size, download count and two actions: Preview (opens an inline modal) and Download.

video, txt, csv and Office files.
Inline Preview
The Preview action opens an inline modal that supports the full mainstream office stack without leaving the product page: Format How it is rendered PDF (.pdf) Streamed inline as application/pdf in an embedded iframe. Images (.jpg, .jpeg, .png, .gif, .webp) Streamed inline as the original image in an <img> tag. Plain text (.txt) Encoding auto-detected (UTF-8, Windows-1252, ISO-8859) and rendered in a styled monospace block. CSV (.csv) Parsed with auto-detected delimiter (comma, semicolon, tab or pipe), BOM-stripped, rendered as a table. Word (.doc, .docx) Rendered to HTML by phpoffice/phpword. Headings, lists, tables and inline images are preserved. Excel (.xls, .xlsx) Rendered to HTML by phpoffice/phpspreadsheet. Cell styles, fonts, colours and borders are preserved (first sheet). PowerPoint (.pptx) Rendered as a stack of 16:9 slide-cards by phpoffice/phppresentation. Heading detection and bullet indent levels are applied. YouTube Embedded via the standard youtube-nocookie.com player. Video (.mp4, .webm) Streamed inline in a native <video controls> element. All Office formats are converted to HTML server-side — no Microsoft Office Online Viewer dependency, no external CDN request, no extra Content-Security-Policy whitelist needed. Legacy binary .ppt (1997–2003) is not supported by phpoffice/phppresentation; the modal shows a friendly «please save as .pptx and re-upload»
message in that case.
Administrative Configuration
All settings live under Stores > Configuration > STM > Product Attachments and are scope-aware down to the store-view level.

- Manage & Import — quick-action buttons to the manage grid and the import form.
- General — module toggle, tab title and tab sort order.
- File — allowed file extensions and maximum file size (MB).
- Display — show / hide file size, type icon, download count; open in new window; sort order; group by category; enable inline preview.
- Attachment Categories — inline grid of category names and sort orders.
- File Extension Icons — dynamic rows for custom file-type icons, labels and badge colours.
- Auto-Assign Rules — enable the nightly cron run for all active rules.
- Access Restrictions — restrict attachments to specific customer groups and control guest downloads.
Internationalization
English is the base language. A German translation (i18n/de_DE.csv) is included. All user-facing strings are fully translatable via the standard Magento CSV format — drop additional files into the i18n/ directory.
Support
Support is provided by Storetown Media through the Adobe Commerce Marketplace support link on this listing. Expected response time is within two business days.
Installation Guide
Requirements
- Magento Open Source 2.4.x or Adobe Commerce 2.4.x
- PHP 8.1, 8.2, 8.3 or 8.4
- Composer 2.x (recommended) or SSH / FTP access for manual upload
- At least one writable media folder: pub/media/stm/attachments/ is created automatically on first upload
- Magento in developer or production mode — default mode is also supported
- Three Composer dependencies for inline Office preview — phpoffice/phpspreadsheet, phpoffice/phpword and phpoffice/phppresentation — are pulled automatically by composer require. All three are MIT-licensed and maintained by the PhpOffice organisation.
Installation via Composer (recommended)
Run the following commands from the Magento project root: composer require storetown-media/module-product-attachments If Magento is in production mode, also run bin/magento setup:static-content:deploy for every active locale.
Manual Installation
Extract the ZIP archive so the module sources land under app/code/STM/ProductAttachments/, then run the same enable / upgrade / compile / flush sequence:
Verification
Confirm the module is active and the schema has been applied: bin/magento module:status STM_ProductAttachments # expected: Module is enabled Open the Magento admin and navigate to Stores > Configuration > STM > Product Attachments. The configuration section must be visible with groups Manage & Import, General, File, Display, Attachment Categories, File Extension Icons, Auto-Assign Rules and Access Restrictions. Open the admin menu Catalog > Product Attachments — three entries must be present: Manage Attachments, Auto-Assign Rules and Import Attachments. On a product detail page in the storefront, add a test attachment to any product from the Product Attachments tab on the product edit page and verify that the attachment appears in the new Attachments tab on the product detail
page in the storefront.
Troubleshooting
Class STM\ProductAttachments\...\X does not exist The module was extracted to the wrong folder. The path must be exactly app/code/STM/ProductAttachments/ (case-sensitive). Delete generated/ and var/cache/, then re-run setup:upgrade and setup:di:compile. Frontend styling missing after install Run bin/magento setup:static-content:deploy -f for each active locale and flush the cache. Note that the attachment table’s CSS is inlined in the template for theme compatibility; no static-content deploy is strictly required for the frontend tab to render. Uploaded file not visible on the product page Verify that the Store View on the attachment row matches the storefront you are looking at, and that any configured Customer Access restriction allows the current visitor. Flush the Full Page Cache after edits. Preview modal shows an empty white box The attachment file could not be loaded in the iframe / image tag. Check that the file exists under pub/media/stm/attachments/ and that your web server serves files from pub/media/ with the right MIME type. The preview controller derives the response Content-Type from the file extension via a whitelist, so make sure the on-disk filename keeps its original extension after upload. Office preview shows a parser error The PhpOffice library could not read the file. This is most often caused by a corrupted upload or a legacy binary .ppt file (PhpPresentation only reads OOXML .pptx). Re-save the document as the modern format and re-upload. If the three phpoffice/* packages are missing, run composer install in the Magento project root and clear the generated cache.
Uninstall
To temporarily disable the module without removing data: bin/magento module:disable STM_ProductAttachments To fully uninstall via Composer: bin/magento module:uninstall STM_ProductAttachments The module creates four own tables (stm_product_attachments, stm_attachment_categories, stm_attachment_file_extensions, stm_attachment_rules) and does not modify any Magento core tables. Uploaded files remain under pub/media/stm/attachments/ after uninstall and can be removed manually if desired.
Licensing
STM Product Attachments is distributed as a commercial Magento 2 / Adobe Commerce extension under the Storetown Media Commercial License. A valid license, acquired through the Adobe Commerce Marketplace or directly from Storetown Media, grants the licensee a non-exclusive, non-transferable right to install and use the software on the number of production and non-production environments specified in the license terms. Full terms are included in LICENSE.txt in the module root.
Support
Support is provided by Storetown Media through the Adobe Commerce Marketplace support link on this listing. Expected response time is within two business days.
CSV Import Reference
Overview
This document lists every public extension point of STM Product Attachments: service contracts, admin routes, configuration paths, database schema, ACL resources and supported file formats. It complements the User Guide, which covers day-to-day usage.
Module Structure
Property Value Module name STM_ProductAttachments Composer package storetown-media/module-product-attachments Install path (app/code) app/code/STM/ProductAttachments/ Install path (Composer) vendor/storetown-media/module-product-attachments/ The module uses PSR-4 autoloading, strict types and no core rewrites — only standard Magento plugin, observer and DI extension points.
Service Contracts
The module ships four repository interfaces in STM\ProductAttachments\Api. Each follows the Magento repository pattern with save(), getById(), delete(), deleteById() and getList(SearchCriteriaInterface). Interface Entity AttachmentRepositoryInterface Product attachment records (one per attachment, linked to product SKU). CategoryRepositoryInterface Attachment categories (grouping on product page). FileExtensionRepositoryInterface Custom file-type definitions (icon, label, badge colour per extension). RuleRepositoryInterface Auto-assign rules with conditions and target file. All interfaces can be replaced via DI preference or extended via plugins.
Admin Routes
All admin routes share the frontName stm_attachment. stm_attachment/manage/index Central attachment grid. stm_attachment/manage/edit Attachment edit form. stm_attachment/manage/save Save edit form (POST). stm_attachment/manage/delete Delete one attachment. stm_attachment/manage/massDelete Mass delete (POST). stm_attachment/manage/massCategoryAssign Mass category assign (POST).
stm_attachment/rule/index Auto-Assign Rules grid. stm_attachment/rule/edit Rule edit form. stm_attachment/rule/save Save rule form (POST). stm_attachment/rule/apply Apply a single rule immediately. stm_attachment/rule/massApply Apply multiple rules (POST). stm_attachment/rule/massDelete Mass delete rules (POST). stm_attachment/import/index Import form. stm_attachment/import/process Handle the CSV upload (POST). stm_attachment/attachment/massAssign Mass-assign form (opened from product grid). stm_attachment/attachment/massAssignPost Handle mass-assign submit (POST). stm_attachment/attachment/upload AJAX file upload endpoint. stm_attachment/category/index Category grid. stm_attachment/category/save Save category (POST). stm_attachment/category/delete Delete category. stm_attachment/extension/index File extension grid. stm_attachment/extension/save Save file extension (POST). stm_attachment/extension/iconUpload AJAX icon upload endpoint. stm_attachment/extension/delete Delete file extension.
Frontend Routes
All frontend routes share the frontName stm_attachment. Purpose stm_attachment/download/index/id/{N} Streams the attachment file inline (Content-Disposition: inline) and increments the per-attachment download counter. stm_attachment/preview/index/id/{N} Renders the attachment for inline preview. PDF, images and video stream as binary; .txt / .csv / .doc / .docx / .xls / .xlsx / .pptx are rendered to HTML server-side via the PhpOffice library family. Response Content-Type is derived from the file extension via a whitelist; files outside that whitelist receive a 404.
Configuration Reference
All configuration values live under the stm_attachments/ path and are scope-aware down to the store view. Config path Description stm_attachments/general/enabled Master toggle for the module. stm_attachments/general/tab_title Title of the frontend attachments tab. stm_attachments/file/allowed_extensions Comma-separated list of allowed extensions. stm_attachments/file/max_file_size Maximum upload size in MB. stm_attachments/display/show_file_size Show file size column in the frontend table. stm_attachments/display/show_file_icon Show file type icon / badge column. stm_attachments/display/show_download_coun t Show download counter column. stm_attachments/display/open_in_new_window Open download links with target=”_blank”. stm_attachments/display/sort_by Sort criterion for the frontend list. stm_attachments/display/group_by_category Group attachments by category on the product page. stm_attachments/display/enable_preview Enable the inline preview modal. stm_attachments/categories/items Dynamic-row list of category definitions. stm_attachments/extension_icons/items Dynamic-row list of custom file-extension definitions. stm_attachments/rules/cron_enabled Enable nightly cron execution of all active rules. stm_attachments/access/restrict_to_custome r_groups Enable customer-group restriction. stm_attachments/access/allowed_customer_gr oups Comma-separated list of allowed group IDs. stm_attachments/access/guest_access Allow unauthenticated visitors to download.
Database Schema
All four tables are created via declarative etc/db_schema.xml. No Magento core tables are modified. Table Columns stm_product_attachments One row per product-attachment link. PK attachment_id. Columns: product_id, file_path, title, file_type (varchar 100), file_size, sort_order, category_id, download_count, video_url, rule_id, created_at. FK product_id → catalog_product_entity, category_id → stm_attachment_categories, rule_id → stm_attachment_rules. stm_attachment_categories Category master data. PK category_id. Columns: name, sort_order, is_active. stm_attachment_file_extensions Custom file-type definitions. PK extension_id. Columns: extension, icon_image, label, color (hex), is_active. stm_attachment_rules Auto-assign rule master data. PK rule_id. Columns: name, is_active, conditions_serialized (JSON), file_path, file_type (varchar 100), file_size, video_url, attachment_title, attachment_category_id, attachment_sort_order, sort_order, created_at, updated_at.
ACL Resources
Resource Guards STM_ProductAttachments::attachments Parent group for all admin menus under Catalog. STM_ProductAttachments::manage Manage Attachments grid and edit form. STM_ProductAttachments::categories Attachment categories CRUD. STM_ProductAttachments::file_extensions File Extension Icons CRUD. STM_ProductAttachments::rules Auto-Assign Rules CRUD and apply. STM_ProductAttachments::import CSV import form and process. STM_ProductAttachments::config System configuration section.
Supported File Types
Out of the box, the uploader accepts the following extensions (configurable under File Settings): Category Extensions Documents pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv Images jpg, jpeg, png, gif, webp Archives zip, rar Video (by URL / upload) YouTube URL, plus direct mp4 / webm via the upload field All listed document, image and video formats are previewable inline via the stm_attachment/preview endpoint. See section 11 for the rendering pipeline.
File Storage
Uploaded files are stored under pub/media/stm/attachments/. Custom file-extension icons are stored under pub/media/stm/extension_icons/. CSV import expects the source files under pub/media/import/attachments/. All paths are relative to the Magento pub/ directory.
Inline Preview Architecture
The preview controller (STM\ProductAttachments\Controller\Preview\Index) dispatches the response by file extension after running access checks (module enabled, preview enabled, customer-group restriction, IDOR check on the parent product, path-traversal guard).
Extension Renderer pdf, jpg, jpeg, png, gif, webp, mp4, webm Streamed inline as binary with the matching MIME from the extension whitelist. txt Encoding auto-detection (UTF-8 / Windows-1252 / ISO-8859), wrapped in a styled HTML page with a <pre> block. csv Auto-detected delimiter (comma, semicolon, tab, pipe), BOM-stripped, str_getcsv-parsed, rendered as an HTML table. doc, docx phpoffice/phpword IOFactory::load → HTML writer. xls, xlsx phpoffice/phpspreadsheet IOFactory::createReaderForFile → WriterHtml::generateHTMLAll (first sheet). pptx phpoffice/phppresentation IOFactory::load (PowerPoint2007 reader); shapes walked via getShapeCollection() and rendered as 16:9 slide-cards with heading-detection and bullet-indent levels. ppt Surfaces a friendly «save as .pptx and re-upload» error body — phpoffice/phppresentation does not parse the legacy binary format. All rendered HTML is wrapped in a self-contained document (inline styles, no external requests) so it can be served safely in an iframe under X-Frame-Options: SAMEORIGIN and X-Content-Type-Options: nosniff.
Licensing
STM Product Attachments is distributed as a commercial Magento 2 / Adobe Commerce extension under the Storetown Media Commercial License. A valid license, acquired through the Adobe Commerce Marketplace or directly from Storetown Media, grants the licensee a non-exclusive, non-transferable right to install and use the software on the number of production and non-production environments specified in the license terms. Full terms are included in LICENSE.txt in the module root.
Support
Support is provided by Storetown Media through the Adobe Commerce Marketplace support link on this listing. Expected response time is within two business days.
Frequently Asked Questions
Which Magento and Adobe Commerce versions are supported?
Magento Open Source 2.4.x and Adobe Commerce 2.4.x, with PHP 8.1, 8.2, 8.3 or 8.4.
Which file types can be attached to a product?
Documents (pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv), images (jpg, jpeg, png, gif, webp) and archives (zip, rar) out of the box, plus video by YouTube URL or as a direct mp4 or webm upload. The accepted list is configurable under File Settings.
Can customers view a file without downloading it?
Yes. The Preview action opens an inline modal on the product page. PDFs and images are streamed inline, text and CSV files are parsed and rendered as formatted blocks, and Word, Excel and PowerPoint files are converted to HTML on the server.
Does the inline preview need extra software?
Three Composer packages handle the Office formats: phpoffice/phpspreadsheet, phpoffice/phpword and phpoffice/phppresentation. All three are MIT-licensed and are pulled in automatically by composer require.
How do I attach files to a large catalogue?
Three routes besides the product edit page: mass-assign from the product grid, bulk import from CSV, and rule-based auto-assignment that attaches a file to every product matching conditions on category, attribute set or any product attribute.
Is a German translation included?
Yes. English is the base language and a German translation ships with the module. Every user-facing string is translatable through the standard Magento i18n CSV format, so further languages need no code changes.
Support
Questions about this extension are answered through the support link on the Marketplace listing. For pre-sales questions and custom requirements, get in touch.
















{% endif %} {% if title and title != "" %}
{{ title }}
{% endif %} {% if excerpt and excerpt != "" %}