source from http://tutorialweb.net/membuat-web-simple-upload-dan-download-file-dengan-php-mysql/ with little change :D