Consolidate attached file handling for better coverage