[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / storeMedia

# Function: storeMedia()

> **storeMedia**(`file`, `options`): `Promise`\<\[`false`, `string`\] \| \[`true`, [`MediaItem`](../interfaces/MediaItem)\]\>

Defined in: [admin/src/media.ts:234](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/media.ts#L234)

Move an uploaded file onto its permanent disk and catalogue it.

Order matters: the bytes land first, and only a successful move is
catalogued. A catalogue entry pointing at a file that isn't there is worse
than a file nobody catalogued, because the panel would keep offering it.

## Parameters

### file

[`UploadedFileLike`](../interfaces/UploadedFileLike)

### options

[`StoreMediaOptions`](../interfaces/StoreMediaOptions)

## Returns

`Promise`\<\[`false`, `string`\] \| \[`true`, [`MediaItem`](../interfaces/MediaItem)\]\>
