PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WM 22] Encode Base 64
[WM 22] Encode Base 64
Iniciado por guest, 31,jul. 2017 22:36 - 5 respuestas
Publicado el 31,julio 2017 - 22:36
Good afternoon,
I'm having some problems when encrypting an Image in Base64, I can't get it to work, it creates a very long string, longer than other Base64 Encoded images I've seen, and it isn't encoding the complete image, only a very little part at the top is visible. Here is my code:

bufFoto is Buffer = dLoadImage("C:\Users\LuisITP\Documents\xt1254\11a.jpg")

buf64 is Buffer = Crypt(bufFoto,"",compressNone + cryptNone,encodeBASE64)

Right now my path is written just for test. Any help would be appreciated.

TIA
Publicado el 01,agosto 2017 - 09:26
base64 added 30% more
Publicado el 01,agosto 2017 - 14:45
Hi,

And what does the result look like?
What makes you think it is incorrect?
Publicado el 01,agosto 2017 - 15:28
It makes me think it's incorrect, because when I put the string in a base 64 decoder, it only shows the top part of the image, like 1/8 of it, and in another post in this forum I read that Windev mobile base 64 encoding, terminates the string incorrectly.
Publicado el 02,agosto 2017 - 17:17
Hi,

Using it to send pictures from mobile to server, no problems in encoding and decoding the base64 string. It is between WM22 and .NET, but it also works between WM22 and WD22.

sBase64String is ANSI string // For android, this is default Base64 !! sBase64String = Crypt(bufImageBuffer ,"",cryptNone,True)
When you send it to a webserver/webservice make sure your webserver is capable of receiving a large enough amount of data.

Danny
Publicado el 03,agosto 2017 - 15:32
Thanks for the info! :) Sorry I didn't mention it before but, my app is for iOS not for android :(