initial commit of file upload.
added usage example.
added more testcase based on feedback
remove unnecessary block copy