Thanks all
I've been on holiday. Sorry for not replying sooner.
cURL has worked now.
It didn't work until the external file was a text file. Then I used curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); to get the contents and used filePutContents and a save path with a new extension of .php.
<?php
$externalFileURL = 'https://domain.com/files/filename.txt';
$ch = curl_init($externalFileURL);
curl_setopt($ch, CURLOPT_URL, $externalFileURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$fileContents = curl_exec($ch);
curl_close($ch);
$savePath = $config->paths->templates . 'filename.php';
$files->filePutContents($savePath, $fileContents);
include $savePath;
?>
Thanks again