2

我想使用后端 webScript/alfresco/service/api/upload上传文件。但问题是我不知道我必须在 POST 上发送的 JSON 应该是什么样子。但是我知道参数是什么:

- filedata, (mandatory) HTML type file You must specify one of: 
  destination (the folder NodeRef where the node will be created) 
  updateNodeRef (the NodeRef of an existing node that will be updated) 
- siteid and containerid (the Site name and the container in that site where the document will be  created)
- uploaddirectory : name of the folder (either in the site container or the destination) where the     document will be uploaded. This folder must already exist
- description : Description for a version update (versionDescription)
- contenttype : The content type that this document should be specialised to
- majorversion
- overwrite
- thumbnails

现在我需要的是 JSON 格式。文件内容应该是什么样子(流或纯/文本?)。任何帮助将不胜感激。

4

1 回答 1

1

必填字段是:

  • “文件数据”:是一个FileSystemResource(JAVA)
  • destination :是文件夹的 nodeRef。
  • uploaddirectory :是该 nodeRef 内的目标目录。

其他字段是可选的。

更新:

这是在 JAVA HERE中上传到 alfresco repositoy 的示例。在他们使用的示例中siteidcontainerid这些字段依次替换destination为站点名称和该站点内的文件夹。

于 2014-05-23T08:52:19.777 回答