1

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

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/CMIS 设置有问题吗?

线程“主”org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException 中的异常:在 org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:487) 中找到.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:629) 在 org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java: 119) 在 org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:95) 在 org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:751) 在 org .apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:469) 在 UploadLargeFile.main(UploadLargeFile.java:31)

第 31 行对应于“Document someDoc = someFolder.createDocument(props, contentStream, versioningState);”

4

1 回答 1

1

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

要解决这个问题,您需要在 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>
于 2016-05-12T10:18:27.500 回答