AnsweredAssumed Answered

Decoding of base64 uploaded files

Question asked by tgus on Mar 6, 2012
I'm accessing the Alfresco web service through PHP and uploading encoded base64 binary and non-binary files. Uploaded non-binary files are not decoded when viewed from Alfresco. Binary types such as PDF are sucessfully uploaded and decoded from Alfresco. The XML below is a sample of what is sent and when "myfile.txt" is viewed in Alfresco it will have "SGVsbG8gV29ybGQh" in its contents and not the decoded message.

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05">
<title>myfile.txt</title>
<summary>Upload of text file</summary>
<content type="text/plain">SGVsbG8gV29ybGQh</content>
<cmis:object>
<cmis:properties>
<cmis:propertyString cmis:name="ObjectTypeId">
<cmis:value>document</cmis:value>
</cmis:propertyString>
</cmis:properties>
</cmis:object>
</entry>

stream_filter_append($stream, 'convert.base64-encode'); is the function in PHP that performs the encoding.

I'm using Alfresco 3.4.6 and this does not appear to be an issue with 3.2. Was there an API change?

Outcomes