You need to sign in to do that
Don't have an account?
asadim
Decoding Attachments back to original format
Hi,
I have a Word document uploaded as an Attachment. When I query for this file in my code (using SforceOfficeToolkit) I get back an Attachment sobject from which I can access its blob (body). I believe the blob is encoded in Base64. To convert this blob back into the original Word format I use a Base64 decoder. The decoder doesn't work with documents that have headers/footers but it works otherwise.
Any ideas how to get this to work? Here's my decoder just in case:
public static byte[] DecodeBase64(string b64) { MSXML2.DOMDocument objXML = new MSXML2.DOMDocument(); MSXML2.IXMLDOMElement objNode = objXML.createElement("b64"); objNode.set_dataType("bin.base64"); objNode.text = b64; return (byte[])objNode.nodeTypedValue; }
Thanks!