kibana/packages/shared-ux/file/file_picker/impl
Vadim Kibana da4307e80e
[Files] Per file max upload size (#151993)
## Summary

Closes https://github.com/elastic/kibana/issues/151985

- ~~This PR introduces `maxUploadSize` file kind setting, which allows
to enforce upload size per file, instead of using one value for the
whole file kind~~.
- ~~I left the `maxSizeBytes` as-is for now, because it is actually used
in two places: (1) in the Files client; (2) in HTTP routes. So, I didn't
find an easy way to reuse it~~.
- Allows to configure max upload size per file.
- This required separation of `FileKind` interface between browser and
server. And correspondingly changes to the file kind registry.


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 10:19:40 +01:00
..
src [Files] Per file max upload size (#151993) 2023-02-27 10:19:40 +01:00
index.tsx
jest.config.js
kibana.jsonc [codeowners] rename global experience to @elastic/appex-sharedux 2023-01-18 10:02:49 -07:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.mdx
tsconfig.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00

---
id: sharedUX/Components/FilePicker
slug: /shared-ux/components/file-picker
title: File picker
description: Pick or upload files from Kibana.
tags: ['shared-ux', 'component', 'files']
date: 2022-11-22
---

## Description

A component designed to capture the UX of picking files. Use cases include:

* A dashboard user wanting to upload an image to their dashboard
* A user picking a new avatar
* A cases user selecting from a set of text files they want to attach to a case
* ...and many more

## Usage

Must be wrapped in the `FilesContext`.

```tsx
<FilesContext ...>
  <FilePicker ... />
</FilesContext>
```