Question
CF Base64 incompatibility to a Java Base64
Hi,
When I download a binary file from an Oracle database with a CF MX7 web front-end (stored in field type CLOB), that was Base64 encoded by Apache's Java implementation of a Base64 encoder (see http://commons.apache.org/codec/api-release/index.html) via CF MX7's ToBinary function, the decoded file size is always slightly larger (e.g. 2365 bytes on a 3.91MB file). I'm aware that there are various RFC specifications for Base64 encoding. According to its reference manual, the CF MX 7 ToBase64 conforms to IETF RFC 2045, which is the same specification that the Apache Java Base64 implementation conforms to. I would be very grateful if someone could tell me why I'm seeing this discrepancy in file size as described above. Are the actual CF source code implementations of ToBase64 and ToBinary available to view? Do these functions adhere strictly to the RFC 2045 specification?
Please note. The standard Sun Java library doesn't include a Base64 class, hence the need for a third-party class. Also, I am aware that Adobe recommends the use of BinaryEncode and BinaryDecode for Base64 encoding/decoding in all new applications. However, I have to upload and download files via a legacy CF web front-end, which I cannot change, that uses the deprecated functions.
Many thanks for your help.
Nigel
When I download a binary file from an Oracle database with a CF MX7 web front-end (stored in field type CLOB), that was Base64 encoded by Apache's Java implementation of a Base64 encoder (see http://commons.apache.org/codec/api-release/index.html) via CF MX7's ToBinary function, the decoded file size is always slightly larger (e.g. 2365 bytes on a 3.91MB file). I'm aware that there are various RFC specifications for Base64 encoding. According to its reference manual, the CF MX 7 ToBase64 conforms to IETF RFC 2045, which is the same specification that the Apache Java Base64 implementation conforms to. I would be very grateful if someone could tell me why I'm seeing this discrepancy in file size as described above. Are the actual CF source code implementations of ToBase64 and ToBinary available to view? Do these functions adhere strictly to the RFC 2045 specification?
Please note. The standard Sun Java library doesn't include a Base64 class, hence the need for a third-party class. Also, I am aware that Adobe recommends the use of BinaryEncode and BinaryDecode for Base64 encoding/decoding in all new applications. However, I have to upload and download files via a legacy CF web front-end, which I cannot change, that uses the deprecated functions.
Many thanks for your help.
Nigel
