Check my blog. I wrote about securing upload box using php. read it you will enjoy it.

http://pyskull.blogspot.com/p/blog-page_26.html