# Importing media There are multiple ways that you can import media into a media set, including: * Direct upload * Connecting to an external source system * Transforms * [Using actions](../../action-types/upload-media/index.md) * OSDK ## Path deduplication If a file is uploaded to a media set and has the same path (usually the filename, such as `example.png`) as an existing item in the media set, the new item will overwrite the existing one. :::callout{theme="warning" title="Deduplication behavior"} You must ensure path uniqueness to avoid overwrites. No warning or confirmation will appear before an upload overwrites an existing media item. ::: An overwritten media item will still be available when using a direct [media reference](../media-overview/index.md#media-references) to that media item. Overwritten media items can also be viewed in the [media item version history](index.md#media-item-version-history) or listed in transforms by setting `deduplicate_by_path=False`. For example: ```python dataset = input_media.dataframe(deduplicate_by_path=False) ``` ## Media item version history When multiple media items are uploaded with the same path, only the most recent item is displayed in the media set. However, you can view the complete version history of uploads at a specific path to see all overwritten media items. To view the version history of a media item path: 1. Select a media item in the media set. 2. In the **Metadata** panel, select **Version History**. ![The Version History button in the Metadata panel.](../../../assets/25fb5c4eab278190d14a5f8580f53a4b900bc44a3782987878eab799550000c7.webp) The version history displays all media items that have been uploaded to that path in chronological order, with the most recent upload listed first. Each entry shows when the media item was uploaded and allows you to preview the content. ![The Version History panel showing multiple uploads at the same media item path.](../../../assets/349fd6016c2acbda7b4963e42a9c28ad02752021f0695cc6c611489037822d3b.webp) :::callout{theme="warning"} Overwritten media items are not permanently deleted from the media set and may still be processed in builds. To manage storage and ensure only the latest items are processed, consider configuring a [retention policy for overwritten items](../media-set-settings/index.md#permanently-delete-any-media-items-that-have-been-overwritten-or-deleted-after). ::: ## Direct upload To import media files to a media set through a direct upload, drag and drop the files into your new media set. Files must match the expected file type specified upon creation of the media set to be uploaded to the media set. 1. First, create a new media set by selecting **New** within a Project and selecting `media set` from the search bar as shown below. ![Create a media set from a Project](../../../assets/f241275d7f7e348c3b51572aa519f72f7ea35f4bb4de36f534db185460916c12.webp) 2. Next, choose the desired media file type for the new media set and select **Create media set**. ![Choose a media file type](../../../assets/1d1dbb0f22a7c719006f5cfad6d8999f30175e0901885894d4950b245353dd75.webp) 3. Once you have created a media set, you can upload media via drag-and-drop onto the empty media set or by selecting the **choose from your computer** prompt. ![Upload from an empty media set](../../../assets/9c3908d5353bc587bb853eb09dce93c2ea9d4ba145e9755ba2863e3e4f4d0b09.webp) ## Connecting to an external source system ### Data Connection Media sets can be imported using a sync to an external source through Data Connection. A detailed walk-through can be found in the [media set sync documentation](../../data-connection/media-set-sync/index.md). To create a new media set [sync](../../data-connection/set-up-sync/index.md), navigate to the **Overview** tab of the desired [source](../../data-connection/set-up-source/index.md). After you create the sync, trigger a build in the media set view for the media to appear in your media set. You can also connect an existing source to a new media set via the **Select a source** option. ![Add existing sources into a media set](../../../assets/20350606e61031df8c4c9c27be147222bfbed9dc9d6e2e5f3e90006fb542756e.webp) #### Virtual media sets For supported source types, media sets can optionally be configured to read directly from the external source system so no data is copied into Foundry's backing store. These are called [virtual media sets](../virtual-media-sets/index.md). ### External transforms For sources with REST APIs, you can import media to a media set through [external transforms](../../data-connection/external-transforms/index.md). ## Transforms ### Pipeline Builder Media sets can also be directly imported into Pipeline Builder. [Learn more about available upload methods in Pipeline Builder.](../../pipeline-builder/datasets-add/index.md)