我想使用以下代码更新 SharePoint 文档库中的文件。如下所述: http: //msdn.microsoft.com/en-us/library/office/dn450841 (v=office.15).aspx#bk_FileRequestExamples http://msdn.microsoft.com/en-us/library/ office/dn292553(v=office.15).aspx#Files
executeAsync 返回成功,但文件未更新!有人可以帮忙吗!?
var spUrl = appWebUrl + "/_api/SP.AppContextSite(@target)/web/GetFileByServerRelativeUrl('" + itemUrl + "')/$value?@target='" + hostWebUrl + "'";
var executor = new SP.RequestExecutor(appWebUrl);
executor.executeAsync(
{
url: spUrl,
type: "POST",
body: "Here is the new Body",
headers: {
"X-HTTP-Method": "PUT",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: readContents,
error: errorHandler,
state: "Update"
});