[android-components](../index.md) / [mozilla.components.support.ktx.android.net](index.md) / [getFileName](./get-file-name.md)

# getFileName

`fun <ERROR CLASS>.getFileName(contentResolver: <ERROR CLASS>): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/net/Uri.kt#L98)

Return a file name for [this](get-file-name/-this-.md) give Uri.

**Return**
A file name for the content, or generated file name if the URL is invalid or the type is unknown

