Issue #8201 by tuj: Encapsulated media upload in directive.