【发布时间】:2014-06-10 20:46:55
【问题描述】:
我想使用以下代码更新 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"
});
【问题讨论】:
标签: javascript rest sharepoint sharepoint-2013 sharepointdocumentlibrary