create upload function.