Zend certified PHP/Magento developer

When adding prefix in media URL category image upload gets affected in Magento 2.4

When I add prefix fs_ in media URL of s3 bucket then getting issue with category image save.

  • When I select image for category image and custom image for first time it gets saved.
    In catalog_category_entity_varchar the Value for image is /media/catalog/category/demo.jpg

  • When I click on save second time then image gets disappear from admin. In catalog_category_entity_varchar the Value for image is fs_/media/catalog/category/demo.jpg

  • When I click on save third time image still disappear from admin. In catalog_category_entity_varchar the value for image is null.

  • In configuration :
    web/unsecure/base_media_url “https://WHATEVER.amazonaws.com/fs_/media/”
    web/secure/base_media_url “https://WHATEVER.amazonaws.com/fs_/media/”

The issue is for category section only and for category image and other custom image attribute.

When I remove fs_ prefix then it working fine.

Please help.