Implement upload function

NOT TEST YET