saveFile
open suspend fun saveFile(data: Flow<ByteArray>, mediaType: String, fileExtension: String? = null, metaData: String? = null, updateHook: (context: ConnectionContext, attachment: Attachment) -> Unit): Attachment
A function which creates a new attachment locally. This new attachment is queued for upload after creation.
The filename is resolved using resolveNewAttachmentFilename.
A updateHook is provided which should be used when assigning relationships to the newly created attachment. This hook is executed in the same write transaction which creates the attachment record.
This method can be overridden for custom behavior.