0

次のコマンドを使用して、Alfresco WS restful にファイルをアップロードしようとしています。

C:\Users\user>curl -v -k -X POST --user admin:admin  -F filedata=C:/temp/wpapper.pdf  -F siteid=documents  -F     containerid=documentLibrary  -F uploaddirectory=PUBLIC  -F     filename=wpapper.pdf  -F contenttype="application/pdf"      http://10.1.1.55:8080/alfresco/service/api/upload

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 10.1.1.55...
* Connected to 10.1.1.55 (10.1.1.55) port 8080 (#0)
* Server auth using Basic with user 'admin'
> POST /alfresco/service/api/upload HTTP/1.1
> Host: 10.1.1.55:8080
> Authorization: Basic Z2xvbWFyb246c2VxMDk4
> User-Agent: curl/7.46.0
> Accept: */*
> Content-Length: 715
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------5ee452c8955311dc
>
< HTTP/1.1 100 Continue
< HTTP/1.1 400 Bad Request
< Server: Apache-Coyote/1.1
< Cache-Control: no-cache
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Pragma: no-cache
< Content-Type: application/json;charset=UTF-8
< Content-Length: 362
< Date: Wed, 18 May 2016 14:03:47 GMT
< Connection: close
<
{
    "status" :
  {
    "code" : 400,
    "name" : "Bad Request",
    "description" : "Request sent by the client was syntactically     incorrect."
  },

  "message" : "Required parameters are missing",
  "exception" : "",

  "callstack" :
  [

  ],

  "server" : "Community v5.1.0 (r122274-b3) schema 9.016",
  "time" : "18/05/2016 10:03:47"
}

* Closing connection 0

ファイルのアップロードに関する Alfresco のマニュアル:

ファイルのコンテンツとメタデータをリポジトリにアップロードします。

POST /alfresco/service/api/upload

HTMLフォームデータ

  • filedata、(必須) HTML タイプのファイル
  • 次のいずれかを指定する必要があります。
    • 宛先 (ノードが作成されるフォルダー NodeRef)
    • updateNodeRef (更新される既存のノードの NodeRef)
    • siteid と containerid (ドキュメントが作成されるサイト名とそのサイト内のコンテナー)。
  • uploaddirectory - ドキュメントがアップロードされるフォルダーの名前 (サイト コンテナーまたは宛先のいずれか)。このフォルダはすでに存在している必要があります
  • description - バージョン更新の説明 (versionDescription)
  • contenttype - このドキュメントが特化されるべきコンテンツ タイプ
  • メジャーバージョン
  • 上書き
  • サムネイル

コンテンツを返す

  • ノード参照

リターンステータス: STATUS_OK (200)

Web スクリプトの説明ドキュメントでは、次のオプションが指定されています。

_________________________________________
Value ------ Description
___________________________________________

json -------> The default response format

user -------> The authentication access
required ---> The transaction level
any   The format style
___________________________________________

PS.: ディレクトリ"PUBLIC"とサイト"documents"は既に存在します。

4

1 に答える 1