I can convert the UserImage image, that is, the one in “userImage.source = Qt.resolvedUrl (path)” in base 64, to be able to upload it to a service, and try:
Image {
source: "data: image / png; base64," + base64imageData
}
but it does not work, the image is uploaded damaged. My server takes the photos in base 64 and converts them to bytes, I test it directly on the server and it works, but since V-play it does not. (if I can consult them)
Try this:
onImagePickerFinished: {
console.debug ("Image picker finished with path:", path)
if (accepted)
userImage.source = Qt.resolvedUrl (path)
fotoruta = Qt.resolvedUrl (path)
// fotoruta = MyImageUrl2Base64.getImageDataByUrl (path)
var c64base = Qt.btoa (path) // Qt.btoa (path) // 1st intent
var c64base = "data: image / png; base64," + userImage.source
console.debug ("Photo:", photo)
console.debug ("Photo64:", c64base)
// post2Server (path)
PhotosAdd (c64base)
errorMsg.text = "Upload OK."
}