I am attempting to create a SharePoint 2013 Online App that will process documents stored on the host site collection.
I'm able to use jQuery ajax to retrieve a file from the host site collection and the format I receive it in appears to be a byte stream (which jQuery appears to store as a string or at least, the data is being interpreted as a string by the browser I'm using to debug).
My conclusion is that I should be sending the received file to a WCF application in order to use C# to write the stream to a file (on the file system of the WCF service) and then extract the content of the resulting file. The resulting file, however, is corrupt. My assumption is that somewhere in the process (SharePoint host to jQuery on App or App to WCF application) the original data is corrupted.
My questions are:
- Is this the simplest method of processing documents using an App or
is there a simpler method of extracting the content of documents on
host sites? - Assuming my current approach is the best approach, is there any way to prevent the file corruption I'm experiencing?
Any assistance would be greatly appreciated.