http://www.phptrick.in/php-file-uploading/

Check out this link for a deailed study