VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Margriet on January 19, 2026, 11:59:30 AM

Title: Image uploads: file_title corrupted with random number
Post by: Margriet on January 19, 2026, 11:59:30 AM
Hello,
I'm experiencing a systematic image upload issue with VirtueMart 4.6.4 on Joomla 5.4.2, confirmed across multiple independent installations on different servers/hosting providers.
Problem Description:
When uploading product images, the file_title field in the #__virtuemart_medias table gets corrupted by having a random number appended after the file extension.
Examples:


Additional Issues:


Environment:

VirtueMart: 4.6.4 (11226)
Joomla: 5.4.2
PHP: [8.3]
Confirmed on multiple installations, different servers and hosting companies

Database Evidence:
SELECT virtuemart_media_id, file_title, file_url, file_is_product_image
FROM #__virtuemart_medias
WHERE file_type = 'product'
ORDER BY virtuemart_media_id DESC
LIMIT 10;
Results show file_title with incorrect extensions and file_is_product_image = 0.
Temporary Workaround:
Running these queries periodically to fix corrupted records:
Fix file_is_product_image
UPDATE `#__virtuemart_medias`
SET `file_is_product_image` = 1
WHERE `file_type` = 'product'
AND `file_mimetype` LIKE 'image/%'
AND `file_is_product_image` = 0;

-- Fix corrupted file_title
UPDATE `#__virtuemart_medias`
SET `file_title` = REGEXP_REPLACE(`file_title`, '\\.(jpg|jpeg|png|gif|webp)_[0-9]+$', '.$1')
WHERE `file_title` REGEXP '\\.(jpg|jpeg|png|gif|webp)_[0-9]+$'
AND `file_type` = 'product';
Questions:


Any guidance would be greatly appreciated. This affects thousands of product images across multiple stores.
Thanks in advance for your help!