Added file upload error handling