Okay, so I’ve modified my script so it creates a file with the chosen name, and it checks file_exists()
$title = 'test a';
$name = rawurlencode($title) . '.pdf';
copy('test.pdf', $name);
echo '<p>Title: ', $title, '</p>', PHP_EOL;
echo '<p>Name: ', $name, '</p>', PHP_EOL;
if (file_exists($name))
echo '<p>File ', $name, ' exists!';
echo '<p><a href="', $name, '">', $title, '</a></p>', PHP_EOL;
It tells me the file does exist, but when I click on the link I get a 404!