A bug poping out with some files failed to download, returning 404. Looking closer at the issue, turned out the files that failed contained ampersand "&" in the filename. PHP would translate the "&" in request path as a key in $_GET variable. So something like:-
$ wget http://www.somesite.com/system/files/fm/somefile_with_&_ampersand.pdf
would result in PHP $_GET as:-
array(
[q] => system/files/fm/somefile_with_
[_ampersand] =>
)
urlencode'ing' the path is not enough because PHP would still translate that to an ampersand.