upgrade upload function
upload function