Hello,
The following code works fine for small files, but I got "SCRIPT14: Not enough storage is available to complete this operation." error when downloading files over 100M.
Is it possible to write the data directly to a local storage (IndexedDB for example) instead of keeping it in memory?
var getFileEndpoint = String.format(
"{0}/_api/SP.AppContextSite(@target)/web/getfilebyserverrelativeurl('{1}')/$value?@target='{2}'",
_SPAppWebUrl, _DocumentUrl, _SPHostUrl);
var executor = new SP.RequestExecutor(_SPAppWebUrl);
var info = {
url: getFileEndpoint,
method: "GET",
//binaryStringResponseBody: true,
success: function (data) {
//Save data to IndexedDB
},
error: function (err) {
//Error handling
}
};
executor.executeAsync(info);
Since my page is located in a SharePoint Hosted App, I can't use XMLHttpRequest directly to access the document in the host site. Seems like the MS cross-domain library is the only choice to me.
Thanks,
Matt.
Matt