# FileUploadPreview

> **Info:** This is documentation for **Stream Chat React Native SDK v7**, which is no longer actively maintained. For up-to-date documentation, see the [latest version (v10)](https://getstream.io/chat/docs/sdk/react-native/).

`FileUploadPreview` is the default UI component for rendering a preview of attached file within MessageInput component.

## Props

### `fileUploads`

List of `file` type attachments currently attached to message, which is being composed in `MessageInput` component.

```tsx
[
  {
    file: {
      name: 'test.pdf';
      size: 2000;
      type: 'application/pdf';
      uri: 'file-uri';
    };
    id: 'asdas232bk3jb42k3';
    state: 'uploaded'; // or 'finished'
    url: 'https://cdn.getstream.io/kajsnkj2n3j4';
  }
]
```

| Type                                                                                          |
| --------------------------------------------------------------------------------------------- |
| [`FileUpload`](https://getstream.io/chat/docs/sdk/react-native/v7/ui-components/message-input/#fileupload-type)[] |

### `removeFile`

Removes attached file in message, which is being composed in `MessageInput` component. By default, this function is attached to `onPress` handler for close button in [FileUploadPreview](https://getstream.io/chat/docs/sdk/react-native/v7/core-components/channel/#fileuploadpreview).
It takes a string ID of the file to be removed in the [`fileUploads`](https://getstream.io/chat/docs/sdk/react-native/v7/contexts/message-input-context/#fileuploads) array as parameter.

| Type                   |
| ---------------------- |
| `(id: string) => void` |

### `uploadFile`

This function is used internally by [`uploadNewFile`](https://getstream.io/chat/docs/sdk/react-native/v7/contexts/message-input-context/#uploadnewfile) function, and is used for purpose retry mechanism.

| Type                                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------------- |
| (\{ newFile: [`FileUpload`](https://getstream.io/chat/docs/sdk/react-native/v7/ui-components/message-input/#fileupload-type) \}) => Promise |

---

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/v7/ui-components/file-upload-preview/](https://getstream.io/chat/docs/sdk/react-native/v7/ui-components/file-upload-preview/).