Hello
I added such code in my custom theme:
// Background image setting.
$name = 'theme_custom/backgroundimage2';
$title = 'backgroundimage2';
$description = 'backgroundimage_desc';
$setting = new admin_setting_configstoredfile($name, $title, $description, 'backgroundimage2');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
Setting seems like OK, I can upload an image, the image is visible under settings tab, but when I try to echo this image using such code
$PAGE->theme->setting_file_url('backgroundimage2', 'backgroundimage2')
it shows such url //mydomainname.com/pluginfile.php/1/theme_custom/backgroundimage2/-1/test.jpg
which points to the not found file.