database upload functions