first running version with file upload todo: optimizing reading buffer size for big file uploads