使用curl发送多个文件

时间:2017-12-18 12:29:17

标签: curl odk

This website同时需要两个文档:一个.xml文件和一个.csv文件。我只能使用curl命令一次上传一个.xml文件:

curl --verbose --digest --header "Content-Type: multipart/form-data" --form "form_def_file=@/Users/xxx/forms/return-receive/return-receive.xml" https://extrasyst.appspot.com/formUpload

我尝试使用此命令提交两个文件

curl --verbose --digest --header "Content-Type: multipart/form-data" --form "form_def_file=@/Users/xxx/forms/return-receive/return-receive.xml"  --form "form_def_file=@/Users/xxx/forms/return-receive/return-receive.csv" https://extrasyst.appspot.com/formUpload

但是它说:

< HTTP/2 400 
< content-type: text/html; charset=utf-8
< x-cloud-trace-context: 440b4dbfc21a68703575bd9a1129918e;o=1
< date: Mon, 18 Dec 2017 12:25:33 GMT
< server: Google Frontend
< content-length: 492
< alt-svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
* HTTP error before end of send, stop sending
< 
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>400 Problem with JavaRosa Parsing Form:
org.opendatakit.aggregate.exception.ODKIncompleteSubmissionData: java.lang.RuntimeException: Document has no root element!</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Problem with JavaRosa Parsing Form:
org.opendatakit.aggregate.exception.ODKIncompleteSubmissionData: java.lang.RuntimeException: Document has no root element!</h1>
</body></html>
* Connection #0 to host extrasyst.appspot.com left intact

我应该更改第二张表格的标签吗?我怎么能一次上传这两个文件?这是一个openrosa支持的opendatakit项目。

0 个答案:

没有答案