You would want to put this as a template override for com_content. Depending on whether you want it to appear on the category page or single article, the file would go
I would make a clone of existing view and then add code below ...
I don't see set() in the JTable docs. You also need to remember to re-encode the full column value before storing. The following is an untested snippet.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->from($db->qn("#__fields_values")); // build all of the non-changing clauses for ...
After some more googling and debugging, I figured it out. The trick was that I'm using a JForm and the file field can be accessed slightly differently. First you need to access the fields tag and then the file field itself (see the bold line below):
The form xml:
<fieldset name="basic" addfieldpath="/...
Thank you to @Lodder for providing a solution, very much appreciated.
@Lodder suggested my class name may be incorrect and said to try 'replacing class mod_CarouselInstallerScript with class mod_Rmg_carouselInstallerScript'.
I changed my class to mod_RRM_carouselInstallerScript which solved the problem.