Some more work on upload logic.