Updated upload functionality