# Upload external data

The [data management service](https://docs.viam.com/data/capture-sync/capture-and-sync-data/) captures and syncs data from your machines automatically. If you have data from other sources (images from your phone, files on your laptop, or data generated by external processes), you can upload it to Viam directly.

| Method | Use case | Deletes local data? | Duplicates on re-run? |
| --- | --- | --- | --- |
| [Directory sync](https://docs.viam.com/data/capture-sync/upload-other-data/#sync-files-from-a-directory) | Sync files that another process writes to a folder on your machine | **Yes** | No |
| [SDK upload](https://docs.viam.com/data/capture-sync/upload-other-data/#upload-with-sdks) | Programmatic upload from any computer | No | Yes |
| [Mobile app](https://docs.viam.com/data/capture-sync/upload-other-data/#upload-images-with-the-mobile-app) | Quick image upload from your phone for ML training | No | No |

## Sync files from a directory

If another process on your machine writes files to a folder (for example, log files, exported CSVs, or images from a third-party application), you can have the data management service sync that folder to the cloud automatically.

Add the directory path to **Additional paths** in the data management service configuration (or `"additional_sync_paths"` in JSON mode). See [Sync data from another directory](https://docs.viam.com/data/capture-sync/capture-and-sync-data/#4-sync-data-from-another-directory-optional) for step-by-step instructions.

**How it works:**

- The data management service monitors the directory and uploads any file that has not been modified for at least 10 seconds (configurable with `file_last_modified_millis` in the [data management service attributes](https://docs.viam.com/data/reference/#data-management-service-attributes)).
- **Uploaded files are deleted from the local directory after successful sync.** If you need to keep a local copy, copy the files to a separate folder and point `additional_sync_paths` at the copy.
- Uploaded files are stored in Viam’s cloud storage and associated with the machine’s `part_id`, `location_id`, and `organization_id`. They are not associated with a specific component or capture method.
- Synced files appear on the **DATA** tab under **Files** (not under Images or Sensors, even if the files are images).

## Upload with SDKs

Use the [Data Client API](https://docs.viam.com/reference/apis/data-client/) to upload files programmatically. Unlike the data management service, the [`FileUploadFromPath`](https://docs.viam.com/reference/apis/data-client/#fileuploadfrompath) method does not delete local files after upload, but it will duplicate data if you run it more than once.

1. Create an [API key](https://docs.viam.com/organization/access/) for your organization, location, or machine.
2. Use [`FileUploadFromPath`](https://docs.viam.com/reference/apis/data-client/#fileuploadfrompath) to upload a file. You must provide a machine part ID to associate the data with.
3. Run your code once. Running it again uploads the same files a second time.
4. Check the [**DATA** tab](https://app.viam.com/data/all) to confirm your data appears.

- [Python](https://docs.viam.com/data/capture-sync/upload-other-data/#tabset-datacapture-syncupload-other-data-1-0)
- [Go](https://docs.viam.com/data/capture-sync/upload-other-data/#tabset-datacapture-syncupload-other-data-1-1)

```py

```

Copy

```go

```

Copy

## Upload images with the mobile app

The Viam mobile app lets you upload images directly from your phone, bypassing the normal capture and sync process. This is useful for quickly collecting training images for machine learning models.

Install the app from the [App Store](https://apps.apple.com/vn/app/viam-robotics/id6451424162) or [Google Play](https://play.google.com/store/apps/details?id=com.viam.viammobile&hl=en&gl=US) if you haven’t already.

1. In the app, select an organization, then tap **Locations** and navigate to the machine you want the data associated with.
2. Tap **…** in the upper right corner, then tap **Upload Images**.
3. Select the images you want to upload and tap **Add**.

Uploaded images are associated with the machine part you selected but not with a specific component or method.

## Next steps

If you uploaded data for machine learning, continue to [create a dataset](https://docs.viam.com/train/create-a-dataset/).
