add upload function