Sub pictureOk_Clicked(Target As String)
Dim imagen64 As String = ""
Dim res As Future
Dim script As String = $"
var img = document.getElementById('foto');
return img.src
"$
res = page.ws.EvalWithResult(script,Null)
page.ws.Flush
Log(res.Value)
imagen64 = res.Value
Dim su As StringUtils
Dim aux2 As String = imagen64.Replace("data:image/png;base64,","")
Dim decoded() As Byte = su.DecodeBase64(aux2)
'Eliminando la foto subida previamente
Dim listaArchivos As List = File.ListFiles (File.DirApp & "/www/" & ABMShared.AppName & "/" & SubFolder & "/temporalfolder/")
For Each elem As String In listaArchivos
If elem.Contains(".") Then
Dim nombre() As String = Regex.Split("__--__", elem.Replace(".","__--__"))
If nombre(0) = "ProfilePic" Then
File.Delete (File.DirApp & "/www/" & ABMShared.AppName & "/" & SubFolder & "/temporalfolder/", elem)
Log ("Eliminando: " & elem)
End If
End If
Next
Dim out As OutputStream = File.OpenOutput(File.DirApp & "/www/" & ABMShared.AppName & "/" & SubFolder & "/temporalfolder/", "ProfilePic.png",False)
out.WriteBytes(decoded, 0, decoded.Length)
out.Close
eliminarobjmodal
page.CloseModalSheet("PictureModal")
End Sub