add upload function.