.B64 file format

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
User avatar
SvA
Posts: 486
Joined: 29 Mar 2006, 02:41
Location: DE

.B64 file format

Post by SvA »

I have got a base64 encoded data stream embeded in an XML file, which I like to decode.

I copied the data into a new file and gave it the extension .b64, but Servant Salamander created only an empty folder on extraction.

I then searched the Internet for a file format specification for .b64 files, but could not find any.

Would you please point me in the right direction.
Jan Patera
Plugin Developer
Plugin Developer
Posts: 707
Joined: 08 Dec 2005, 14:33
Location: Prague, Czech Republic
Contact:

Re: .B64 file format

Post by Jan Patera »

SvA wrote:I have got a base64 encoded data stream embeded in an XML file, which I like to decode.
I copied the data into a new file and gave it the extension .b64, but Servant Salamander created only an empty folder on extraction.

I then searched the Internet for a file format specification for .b64 files, but could not find any.
Would you please point me in the right direction.
If you want the UnMime plugin to recognized Base64-encoded data, precede the data with the following line, followed by one more empty line.
Content-transfer-encoding: BASE64

BASE64 encoding is very simple - every 3 bytes of input data are converted into 4 characters from 64-item alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". In case the size of the input is not divisible by 3, then the last output quadruplet is padded by '=' signs. E.g.:
ABCDEF== decodes as 0x00 0x10 0x83 0x10.
User avatar
SvA
Posts: 486
Joined: 29 Mar 2006, 02:41
Location: DE

Post by SvA »

Thank you, Jan, for your response.

Adding mime headers and breaking up the character stream into lines of 76 characters according to mime standard was what I did, since it was the UnMIME plugin which felt responsible.

Without breaking up the lines (i.e. just adding the header(s) I got a corrupted image on decoding (without any warning!).

There are many references to the .b64 extension related to base64 encoded data, so I thought there must be also a file specification (similar to a uuencoded file which has a file header) or else the file contains nothing but the encoded data stream (possibly with added white space.

Are there any requirements on a MIME file to be legitimately called .b64 (in general, not limited to Servant Salamander)?
Jan Patera
Plugin Developer
Plugin Developer
Posts: 707
Joined: 08 Dec 2005, 14:33
Location: Prague, Czech Republic
Contact:

Post by Jan Patera »

SvA wrote:Are there any requirements on a MIME file to be legitimately called .b64 (in general, not limited to Servant Salamander)?
I don't think there is any standard/recommendation for exact file suffix and/or structure. There is no real reason to have standalone base64-encoded files, the encoding is meant to be transfer encoding, not file storage encoding, although various file formats (such as PostScript or PDF) may use it internally.
Post Reply