All files from the attachment field types mapped to corresponding fields in Sitecore are imported into the Sitecore Media library. The default location for all such items is /sitecore/media library/Gather Content/. Under the GatherContent media folder, all items are structured in the following way ///. If a mapped field has a specified datasource, all files will be imported to that location.

The plugin architecture is extensible and the logic of uploading items can be overridden. A new class should be created that inherits the IMediaRepository interface:

namespace GatherContent.Connector.IRepositories.Interfaces
{
public interface IMediaRepository<T>: IRepository where T: class
{    
T UploadFile(string targetPath, File fileInfo);
string ResolveMediaPath(CmsItem item, T createdItem, CmsField field);
}
}

ResolveMediaPath method should implement logic on resolving media path. Media path can be a path to media folder in Sitecore or to any other storage (drive, could service etc.)

UploadFile method defines how the importing file will be uploaded to that storage

After the new class is developed, it should be registered in the Dependency Injection configuration file, which is

/App_Config/GatherContent.Connector.Repositories.config

Find MediaRepository component and replace current type to newly created on

<component>
id="MediaRepository"
lifestyle="Transient" service="GatherContent.Connector.IRepositories.Interfaces.IMediaRepository`1
[[Sitecore.Data.Items.Item, Sitecore.Kernel]],
GatherContent.Connector.IRepositories"
type="<namespace>.<new class name>, <assembly name>">
</component>
Did this answer your question?