Sharepoint REST api更新文件内容而不创建新版本 [英] Sharepoint REST api update file contents without creating new version

查看:88
本文介绍了Sharepoint REST api更新文件内容而不创建新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

b

Hi,




我使用的是GetFileByServerRelativeUrl [1] api来更新文件的内容。我不想为文件创建不必要的新版本。

I'm using the GetFileByServerRelativeUrl [1] api to update the content of a file. I don't want to create unnecessary new versions for a file.

Office365 Word不会在保存时创建额外版本而无需结帐。 />

Office365 Word does not create extra versions on save without checkout.




说明:

Explanation:

我正在构建一个可以编辑存储在sharepoint上的文件的应用程序。

I'm building an app which can edit files stored on sharepoint.




- 用户1打开并编辑文件X(他/她是b $ b 选择不结帐文档)。

- User 1 opens and edits file X (He/She chooses to not checkout the document).

- 用户1保存文件X.(创建版本12)

- User 1 saves file X. (Version 12 is created)

- 用户1继续编辑。

- User 1 continues editing.

- 用户1保存文件X.(版本13已创建)

- User 1 saves file X. (Version 13 is created)




由于用户没有退出我的应用程序,因此不应在保存时增加版本。只有在User 1编辑时用户2编辑文件时,版本才会增加。

Since the user did not exit my app, the version should not be increased on save. The version should only increase if a User 2 edits the file while User 1 was editing.




我无法找到Office365保存的方法。如果用户没有退出我的应用,请保存文件的最新版本。

I cannot find a way to do what Office365 does on save. To save over the last version of the file if the user did not exit my app.

我猜猜api应该允许一个额外的参数,比如版本,保存...或者sessionId,让sharepoint知道我的应用编辑会话没有关闭。

I'm guessing the api should allow for an additional param, like version, over which to save.. Or sessionId, to let sharepoint know my app editing session was not closed.




[1]  https://msdn.microsoft.com/en-us/library/office/dn450841.aspx#code-snippet-3

[1] https://msdn.microsoft.com/en-us/library/office/dn450841.aspx#code-snippet-3

推荐答案

据我所知,REST API没有提供另一个控制版本的参数。

As I understand, REST API not provide another param to control version.

一种解决方法是在编辑之前检查文件。

A workaround is that checking out the file before editing it.

谢谢

最好的问候


这篇关于Sharepoint REST api更新文件内容而不创建新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆