03-03-2011 03:07 AM
<request>
<officeName>office_0001</officeName>
<worksheetId>worksheet_0001</worksheetId>
<documentName>document_0001.txt</documentName>
<documentMimetype>text/plain</documentMimetype>
<documentContent>aGVsbG8gd29ybGQh</documentContent>
</request>
logger.log(serviceName+": decoding base64 data, size: "+documentContent.length);
var contentData = Base64x.decode(documentContent);
logger.log(serviceName+": base64 data decoded, size: "+contentData.length);
var newDocumentNode = worksheetFolderNode.createFile(model.documentName);
if (newDocumentNode != null) {
newDocumentNode.content=contentData;
newDocumentNode.save();
logger.log(serviceName+": new document size: "+newDocumentNode.size);
}
Size of original data before base64 encode: 5921
Test with PHP's utf8_encode: UTF-8 size of binary data: 8870
18:29:17,503 User:admin DEBUG [repo.jscript.ScriptLogger] upload: decoding base64 data, size: 7896
18:29:17,536 User:admin DEBUG [repo.jscript.ScriptLogger] upload: base64 data decoded, size: 5921 (SAME AS ORIGINAL SIZE)
18:29:17,590 User:admin DEBUG [repo.jscript.ScriptLogger] upload: new document size: 8870 (LOOKS LIKE UTF-8 ENCODED SIZE)
03-09-2011 05:52 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.