1

本网站同时需要两个文件:一个 .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 项目。

4

0 回答 0