# ShareTarget.FileFormField

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/trusted/sharing/ShareTarget.java+class:androidx.browser.trusted.sharing.ShareTarget.FileFormField) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

*** ** * ** ***


```
class ShareTarget.FileFormField
```

<br />

*** ** * ** ***

Defines a form field for sharing files.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#KEY_ACCEPTED_TYPES() = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES"` Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#KEY_NAME() = "androidx.browser.trusted.sharing.KEY_FILE_NAME"` Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#FileFormField(java.lang.String,java.util.List<java.lang.String>)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, acceptedTypes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Creates a `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField` with the given parameters. |

| ### Public properties |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()` List of MIME types or file extensions to be sent in this field. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()` Name of the form field. |

## Constants

### KEY_ACCEPTED_TYPES

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
const val KEY_ACCEPTED_TYPES = "androidx.browser.trusted.sharing.KEY_ACCEPTED_TYPES": String!
```

Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()`.

### KEY_NAME

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
const val KEY_NAME = "androidx.browser.trusted.sharing.KEY_FILE_NAME": String!
```

Bundle key for `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()`.

## Public constructors

### FileFormField

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
FileFormField(name: String, acceptedTypes: (Mutable)List<String!>)
```

Creates a `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField` with the given parameters.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#name()`. |
| `acceptedTypes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | The `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget.FileFormField#acceptedTypes()`. |

## Public properties

### acceptedTypes

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
val acceptedTypes: (Mutable)List<String!>
```

List of MIME types or file extensions to be sent in this field. The MIME type matching algorithm is specified by https://wicg.github.io/web-share-target/level-2/#determining-if-a-file-is-accepted.

### name

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

```
val name: String
```

Name of the form field.