xml code with Base64
Enrique Arredondo
henry at vegena.net
Mon Jun 7 08:23:46 PDT 2004
Hi list.
Our vendor is requiering from us to send photos within the xml that I'm
going to generate to them, So it should look something like this :
......
<Images>
<Image>
<MaintenanceType>A</MaintenanceType>
<Style>ZZ1</Style>
<FileType>JPG</FileType>
<FileSize>55</FileSize>
<FileSizeUOM>KB</FileSizeUOM>
<DPI>72</DPI>
<ColorMode>RGB</ColorMode>
<Background>WHI</Background>
<OrientationView>FRO</OrientationView>
<ImageFile>/9j/4AAQSkZJRgABAgEBLAEsAAD/7QGEUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABABLAAAAAEA
AQEsAAAAAQABOEJJTQQNAAAAAAAEAAAAeDhCSU0D8wAAAAAACAAAAAAAAAAAOEJJTQQKAAAAAAAB
.....etc....</ImageFile>
</Image>
</Images>
How in the world can I do that within a filepro report ? I believe the
maximum characters per dummy field is 255 chars. To convert to Base64 a
jpg I'll use this script and then put the file in a place where filepro
can pick it up when generating the XML :
#!/usr/local/bin/perl w
use MIME::Base64 qw(encode_base64);
open(FILE,
'/usr2/tmp/file.jpg')
or die "$!";
while (read(FILE, $buf, 60 * 57)) {
print encode_base64($buf);
}
More information about the Filepro-list
mailing list