In the case of a change of server, check if you have copied the content of moodledata, especially uploaded files.
Also make sure the file name contains no special characters like '#'
You may also get this error if you have moved files after linking to them from the course page.