Most likely, this is just a matter of a file name. The expression
"$upload_path$filename"
lacks directory separator in the path, '/'.
Generally, run your code under the browser. When a page is loaded, use browser's "View page source" (or something like that) to see what HTML was actually generated. Check up
src
value, in particular. Compare with the actual file name of the server side. Fix it.
[EDIT]
Oh, no! Need to know the directory separators, path names? Please see:
http://en.wikipedia.org/wiki/Path_%28computing%29[
^].
—SA