Moved upload to directive.