import { selectFile } from "./selectFile"
const file = await selectFile()
if (file) {
// some something with the file...
}
selectFiles()
Prompt user to select multiple files:
import { selectFiles } from "@corets/input-helpers"
const files = await selectFiles()
if (files.length > 0) {
// do something with the files...
}
selectFileOfType()
Prompt user to select a file of a specific type:
import { selectFileOfType } from "@corets/input-helpers"
const file = await selectFileOfType('image/*')
if (file) {
// so something with the file
}
selectFilesOfType()
Prompt user to select multiple files of a specific type:
import { selectFilesOfType } from "@corets/input-helpers"
const files = await selectFilesOfType('image/*')
if (files.length > 0) {
// so something with the files...
}