---
title: getMediaAssetFromFile
status: published
category: editor
group: Function
author: api
date: 06/23/2023
order: 45
---<Small>Public Function</Small>

Get an asset from a file.


##### Parameters


<ParametersTable>

<ParametersTableRow>
<ParametersTableName>

`file`

</ParametersTableName>
<ParametersTableDescription>

```ts
File
```

The file.




</ParametersTableDescription>
</ParametersTableRow>
</ParametersTable>

##### Returns


```ts
Promise<TLAsset>
```

 An image or video asset partial.


##### References

[TLAsset](/gen/tlschema/TLAsset-type)

