Check below code which I have used for upload image in configuration.
<field id="icon" translate="label comment" type="image" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Icon</label>
<backend_model>Magento\Config\Model\Config\Backend\Image</backend_model>
<upload_dir config="system/filesystem/media" scope_info="1">{vender_name}/{module_name}/icon</upload_dir>
<base_url type="media" scope_info="1">{vender_name>/{module_name}/icon</base_url>
</field>
But when I try to retrieve image URL based on below code, It's getting only default/image_name.ext
$this->scopeConfig->getValue("<section>/<group>/icon", \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
How can I get full path of image URL?
Best Answer
You can use ObjectManager or Block.
Objectmanager :
Block :
Call the function :
And don't forget to add your module class to XML.
example :