Open a file saver dialog in a Kotlin Multiplatform project
PlatformFile
object representing where the user wants to save the file. Note that the file is not created automatically - it’s the developer’s responsibility to write the actual data to the file location using methods like write()
.
Here’s a basic example:
suggestedName
: The default name for the file without extensionextension
: The file extension without the dot (e.g., “pdf”, “txt”)directory
: The starting directory for the save dialogdialogSettings
: Platform-specific settings for customizing the dialog behaviorPlatformFile
object representing the selected save location. You can write data to this file using the write()
extension function:
FileKit.download()
:
FileKit.download()
to download files directly.