BASE64 ENCODE FILE()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to generate the base64 encoded contents of a file and output it into the HTML5

Syntax

BASE64_ENCODE_FILE(<cFilename> [, <cType> [, <cWidth> [, <cHeight> [, <cCSSattribute>]]]])

See Also

BASE64_DECODE(), BASE64_ENCODE(), BASE64_ENCODE_IMAGE()

Description

The BASE64_ENCODE_FILE() function is used to generate the base64 encoded contents of the file <cFilename> and output it into a WebView or the HTML5 sent to a browser. The optional <cType> can be used to specify the file type. If <cType> is an image type, the output will be enclosed in an IMG tag and the <cWidth> and <cHeight> can be used to specify the image dimensions and <cCSSattribute> to add additional CSS attributes.


Example

<%@ Language=VFP %>
<html>
<head>
<style>
.pics
  {
  opacity:0.4;
  }
.pics:hover
  {
  opacity:1.0;
  }
</style>
</head>
<body>
<%
? "<table width='80%' align=center cellpadding=12>"
? "<tr>"
? "<td align=center>"
? "<h1>Lianja example</h1>"
? '<p>Customize this to suit your own needs. This is a just an example.<p>'
? '<hr size="1px" color="lightgray"/>'
? "</td>"
? "</tr>"
? "<tr>"
? "<td>"
? "<h3>Image</h3>"
? "</td>"
? "</tr>"
? "<tr>"
? "<td  align=center>"
base64_encode_file("babyray.jpg","jpg","472px","284px","class='pics'")
? "</td>"
? "</tr>"
 ? "<tr>"
? "<td align=center>"
? "<p>Copyright © 2013 Lianja Inc. All rights reserved worldwide.</p>"
? "<h3><a href 'http://www.lianja.com'> www.lianja.com</a></h3>"
? "</td>"
? "</tr>"
? "</table>"
%>
</body>
</html>