我正在创建一个 Azure 逻辑应用,它将在 FTP 服务器上创建一个新文件(来自大约 5KB 的 HTTP 正文内容(。
以下是 FTP 创建文件代码片段:
{
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['ftp']['connectionId']"
}
},
"method": "post",
"body": "@body('Provider_Post')",
"path": "/datasets/default/files",
"queries": {
"folderPath": "/",
"name": "filename_@{utcNow()}.xml",
"queryParametersSingleEncoded": true
},
"authentication": "@parameters('$authentication')"
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
}
此步骤需要很长时间(32 分钟(,然后失败并显示以下错误:
MaxRequestCountReached. The maximum number of requests allowed '1000' was not sufficient to upload the entire content. Uploaded content length: '2378'. Total content length: '4877'.
该文件显示在 FTP 服务器上,但距离文件末尾只有 2380 字节。
此错误是什么意思以及如何修复它? 5KB 不应该是太多的数据。这是关于FTP服务器的事情吗?我可以毫无问题地使用 FileZilla 发送文件。
我什至对此进行了测试,以便我创建了另一个步骤(在失败的步骤之前(,它将 HTTP 内容状态代码(因此,只是"200"(发送到一个新文件,并在一秒钟内成功写入它。
这种行为不端的原因是我在 ftp API 连接设置中禁用了二进制传输。
当我启用二进制传输复选框时,它在几秒钟内写入了文件。