merge the buffer upload functions