New upload function.