I've created my own module called - presentationupload and followed, as far as possible, the moodledocs documentation. The files are now uploading to moodledata and all seems fine there.
However is there any reason my view.php might not be using my own module's lib.php file.
$url = moodle_url::make_pluginfile_url(
$result->filearea, // $file->get_filearea(),
echo "<br />URL is ".$url;
$out = html_writer::empty_tag('img', array('src'=> $url));
writes the URL on the screen but doesn't show the graphic file that is stored - the broken image file appears.
I've stuck some echo statements into the library function which don't come up.
Attached them both.
Any help gratefully received.