update the upload sample function