rest protocol upload function (fist steps)