Updated file upload functionality