Jamy
02/23/2021, 3:12 AMUpload
form control but when I want to get my file from my form, It always return null on upload
field even if I used your sample on your doc: Client side file handling
val pictureForm = formPanel<Request> {
add(Request::upload,
Upload(multiple = false, label = "Upload files (images only)").apply {
showUpload = false
showCancel = false
explorerTheme = true
dropZoneEnabled = true
allowedFileTypes = setOf("image")
})
}
button("Submit").onClick {
GlobalScope.launch {
val fdata = pictureForm.getDataWithFileContent()
val firstImage = fdata.upload?.firstOrNull()?.content
if (firstImage != null) {
Alert.show("Image", "<img src=\"$firstImage\">", rich = true)
}
console.log(firstImage)
}
}
Robert Jaros
02/23/2021, 7:58 AMuploadUrl
parameter/
valueJamy
02/23/2021, 8:16 AMRobert Jaros
02/23/2021, 9:15 AM