Don't worry about it... I just figured out the problem:
If the filename contains a space the upload procedure adds a hyphen in the filename. But the encoding procedure is still looking for the original name. Can this be fixed since lots of people might make the same mistake as I did?