Base64Encode

The Base64Encode function does Base64 binary file encoding.

Base64Encode [data]

Parameters

data
Optional. String to encode. If specified, the function encodes data from this string. If not, the function encodes data from file, previously set by Base64EncodeStart.

Return value

If optional paramater is specified, the function returns Base64 encoded string data for whole source string in one call. Overwise, the sunsequent function callings return encoded ASCII strings, string by string. The empty string means there are no more data.

Example

<%
............
Set tcpip=CreateObject("SHOTIP.Connection")
eol=Chr(13)&Chr(10)

............

' Start encoding
tcpip.Base64EncodeStart("c:\pict.jpg")
Do While True
	str=tcpip.Base64Encode()
	if str="" then Exit Do
	tcpip.Send str & eol
Loop

............

%>