update the upload js function