Rewrite file upload

Signed-off-by: Thynson <lanxingcan@gmail.com>