Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 11 Monaten, 3 Wochen
Letzter Beitrag:
vor 11 Monaten, 3 Wochen
Beteiligte Autoren:
Luis Antonio Gutiérrez Flores, Danny Lauwers, ccc2, Fabrice Harari

[WM 22] Encode Base 64

Startbeitrag von Luis Antonio Gutiérrez Flores am 31.07.2017 20: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.



base64 added 30% more

von ccc2 - am 01.08.2017 07:26

And what does the result look like?
What makes you think it is incorrect?

von Fabrice Harari - am 01.08.2017 12:45
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.

von Luis Antonio Gutiérrez Flores - am 01.08.2017 13:28

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.


von Danny Lauwers - am 02.08.2017 15:17
Thanks for the info! :) Sorry I didn't mention it before but, my app is for iOS not for android :(

von Luis Antonio Gutiérrez Flores - am 03.08.2017 13:32
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.