Updated file upload handler