2022-06-20 15:34:45 -07:00
|
|
|
### Single constrained example
|
|
|
|
|
|
|
|
|
|
```svelte example raised column
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { Field, FileUpload } from 'omorphia'
|
|
|
|
|
|
2022-06-20 23:50:33 -07:00
|
|
|
let file: File
|
2022-06-20 15:34:45 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<Field label="Upload image">
|
2022-06-20 23:50:33 -07:00
|
|
|
<FileUpload accept="image/*" constrained bind:file />
|
2022-06-20 15:34:45 -07:00
|
|
|
</Field>
|
|
|
|
|
|
|
|
|
|
File name: {file?.name}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Multiple example
|
|
|
|
|
|
|
|
|
|
```svelte example raised column
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { Field, FileUpload } from 'omorphia'
|
|
|
|
|
|
2022-06-20 23:50:33 -07:00
|
|
|
let files: File[] = []
|
2022-06-20 15:34:45 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<Field label="Upload file">
|
2022-06-20 23:50:33 -07:00
|
|
|
<FileUpload accept="*" multiple bind:files />
|
2022-06-20 15:34:45 -07:00
|
|
|
</Field>
|
|
|
|
|
|
|
|
|
|
Count: {files.length}
|
|
|
|
|
```
|