Base64 To JPG Possible?

Nov 7, 2012

This code convert jpg to base64. Well base64 to jpg convert possible?

Code:

Public Function EncodeFile(strPicPath As String) As String
Const adTypeBinary = 1 ' Binary file is encoded
' Variables for encoding Dim objXML Dim objDocElem
' Variable for reading binary picture Dim objStream
' Open data stream from picture
Set objStream = CreateObject("ADODB.Stream")

[Code] ........

View 2 Replies


ADVERTISEMENT

Encode / Decode A Byte Array To / From Base64 Format

May 29, 2014

I am trying to make an encode/decode function to use in excel from base64 to array of bytes

I want to put string encoded in base64 in cell1 and get result in cell2 with decoded array of bytes and vice versa i find some codes [URL]....

and a code here

[URL]....

using the code above to convert A1
A1 = a03060fa564665
ENCODEBASE64(A1) -> YTAzMDYwZmE1NjQ2NjU= (which is correct result for string "a03060fa564665" not the array of bytes)
while correct result i need is oDBg+lZGZQ==

i know the issue is converting string to array of bytes but i couldn't fix it myself

example
if cell1= a03060fa564665
result1= oDBg+lZGZQ==
if cell2= oDBgm1BGaQ==
result2= a030609b504669

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved