rememberFileUploadPattern
Creates and remembers a FileUploadPatternState to manage file upload logic within a Composable.
This function initializes the necessary launchers for picking files from the system or capturing media via the camera. It abstracts the complexity of handling different selection modes (single vs. multiple) and source types.
Return
A FileUploadPatternState used to trigger the pickers and query the current selection configuration.
Parameters
Callback invoked when files are successfully selected or captured. Returns an empty list if the selection is cancelled or an error occurs.
The category of files to be selected (e.g., Image, Video, or generic File). This also determines the available sources like Camera or Gallery.
The selection strategy: FileUploadMode.Single for one file or FileUploadMode.Multiple for several files with an optional limit.
An optional title displayed in the file picker system dialog.
An optional initial directory for the file picker to open in.
Specific configuration for the picker dialog, primarily for desktop platforms.