无法通过SharePoint 2013中的CMIS API上载大于37MB的文档



My SharePoint 2013版本为15.0.4569.1506。我无法通过下面的CMIS代码在SharePoint中上传大于37MB的文档。但直接进入SharePoint我可以做到。我还尝试过增加堆大小/缓存限制。我得到一个异常-"CmisRuntimeException:Found"

Folder someFolder = (Folder) session.getObjectByPath("/TestFolder");
File file = new File("C:/Users/Administrator/Desktop/50MBFile.zip"); 
String fileName = file.getName();
Map<String, Object> props = new HashMap<String, Object>();
props.put("cmis:objectTypeId", "cmis:document");
props.put("cmis:name",fileName);
String mimetype = "application/octet-stream";
ContentStream contentStream = session.getObjectFactory().createContentStream(fileName,
    file.length(),
    mimetype,
    new FileInputStream(file));
VersioningState versioningState = null;
Document someDoc = someFolder.createDocument(props, contentStream, versioningState );

我使用了AtomPub绑定。我的代码或我需要更改的任何其他SharePoint/CMS设置是否有问题?

线程"main"org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException异常:找到网址:org.apache.chemistry.oopenmis.client.bindings.spi.atompub.AbstractAtomPubService.covertStatusCode(AbstractAtomPubService.java:487)网址:org.apache.chemistry.oopenmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:629)网址:org.apache.chemistry.oopenmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java:119)网址:org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:751)网址:org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:95)网址:org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:469)在UploadLargeFile.main(UploadLarge File.java:31)

其中第31行对应于"Document someDoc=someFolder.createDocument(props,contentStream,versionState);"

检查web.config文件中3个位置的最大允许限制:

为了解决这个问题,您需要在TARGET农场的三个位置增加maxRequestLength值:

  • 管理中心web.config文件(通常位于C:\Inetpub\wwwroot\wss\VirtualDirectories\DirectoryName中)

  • web应用程序主web.config文件(通常位于C:\Inetpub\wwwroot\wss\VirtualDirectories\DirectoryName中)。

  • 内容部署web.config文件位于:C: \Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\ADMIN\Content Deployment

打开位于每个位置的web.config文件,找到maxRequestLength属性。增加它以允许上载您拥有的最大CAB文件。默认设置将CA和web应用程序的上载文件大小限制为51200 KB,将内容部署的上载文件尺寸限制为102400 KB。

<configuration>
  <system.web>
    <httpRuntime maxRequestLength=”102400″ />
  </system.web>
</configuration>

最新更新