Handle large files gracefully