new upload logic