Download the PHP package mgh-tech/magento2-dev-media-downloader without Composer
On this page you can find all versions of the php package mgh-tech/magento2-dev-media-downloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mgh-tech/magento2-dev-media-downloader
More information about mgh-tech/magento2-dev-media-downloader
Files in mgh-tech/magento2-dev-media-downloader
Package magento2-dev-media-downloader
Short Description Magento 2 module for on-demand downloading of missing media files from a remote instance during development.
License MIT
Informations about the package magento2-dev-media-downloader
MGH DevMediaDownloader
A lightweight Magento 2 module for on-demand downloading of missing media files from a remote instance during development and testing.
Overview
MGH\DevMediaDownloader streamlines development and testing workflows by automatically downloading missing media files (such as product images) from a remote Magento instance. This module is designed for development, staging, or CI environments where the full media library is not available locally, but is accessible from a production or reference server.
Problem & Solution
Working with a local development environment often means missing large media files. Rather than synchronizing entire media folders, this module intelligently fetches media assets on-demand from your remote instance, improving both developer experience and CI/CD efficiency.
How It Works
When a media file (e.g., an image in /pub/media/) is requested and not found locally:
- The module intercepts the request
- Attempts to fetch the file from a configured remote base URL
- If successful, saves it locally for future requests
- Serves the file as if it were present from the start
Workflow Diagram
Key Features
- Seamless on-demand downloading of missing media files from a remote Magento instance
- Intelligent caching - once downloaded, files are stored locally for fast retrieval
- Supports Magento's product image cache structure and fallback logic
- Safe downloads - only downloads valid image files (jpg, jpeg, png, gif, webp, avif, svg)
- Developer-mode only - automatically disabled in production environments
- Robust error handling with comprehensive debug logging
- Configurable remote base URL - point to any Magento instance (support for multi-website setups)
- Compatible with Fastly CDN - includes dedicated plugin for Adobe Commerce with Fastly
Installation
Option 1: Via Composer (Recommended)
Option 2: Manual Installation
-
Place the module under
app/code/MGH/DevMediaDownloaderin your Magento 2 project: -
Register the module by running setup upgrade:
- Configure the module (see Configuration section below)
Configuration
The module provides the following configuration options under Stores > Configuration > Dev Tools > Dev Media Downloader:
| Setting | Type | Description |
|---|---|---|
| Enable On-The-Fly Download | Boolean | Toggle the module on/off. Only active in developer mode. |
| Remote Base URL | Text | The base URL of the remote Magento instance (e.g., https://production.example.com). Do not include a trailing slash. |
Configuration via Admin Panel
- Navigate to Stores > Configuration > Dev Tools > Dev Media Downloader
- Enable the module
- Set the remote base URL
Configuration via Command Line
Alternatively, configure the module using the command line:
Example Configuration
Requirements
- PHP >= 7.4
- Magento 2.4.x (or compatible OpenMage/Magento Open Source)
- ext-curl - PHP cURL extension (required for remote downloads)
Compatibility
- ✅ Magento Open Source 2.4.x
- ✅ Adobe Commerce 2.4.x
- ✅ Adobe Commerce Cloud with Fastly CDN
License
This module is licensed under the MIT License. See the LICENSE.txt file for details.
Author
mgh-tech - Magento 2 Development & Solutions
GitHub: github.com/mgh-tech
Support & Contributions
For issues, questions, or contributions, please visit the GitHub repository.