Welcome! Log In Create A New Profile

Advanced

[WM 22] Encode Base 64

Posted by Luis Antonio Gutiérrez Flores 
Luis Antonio Gutiérrez Flores
[WM 22] Encode Base 64
July 31, 2017 10:36PM
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
ccc2
Re: [WM 22] Encode Base 64
August 01, 2017 09:26AM
base64 added 30% more
Fabrice Harari
Re: [WM 22] Encode Base 64
August 01, 2017 02:45PM
Hi,

And what does the result look like?
What makes you think it is incorrect?
Luis Antonio Gutiérrez Flores
Re: [WM 22] Encode Base 64
August 01, 2017 03:28PM
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.
Danny Lauwers
Re: [WM 22] Encode Base 64
August 02, 2017 05:17PM
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



Edited 1 time(s). Last edit at 08/02/2017 05:18PM by Danny Lauwers.
Luis Antonio Gutiérrez Flores
Re: [WM 22] Encode Base 64
August 03, 2017 03:32PM
Thanks for the info! smiling smiley Sorry I didn't mention it before but, my app is for iOS not for android sad smiley
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: