使用 cURL -F,Powerpoint 上传停止在 ~9MB

Powerpoint upload stops at ~9MB with cURL -F

上传大于 9MB 的文件时,我在使用 ConvertApi.com PowerPoint2Pdf 转换时遇到问题。我可以通过浏览器形式上传至少 43MB 的 PowerPoint 文件没有问题,所以它应该不是 API 中的限制。

如果大小小于此大小,当我使用此行 (Applying these instructions, with the appropriate changes):

时,转换与 curl 完美配合

curl -v -F file=@"filename.pptx" http://do.convertapi.com/PowerPoint2Pdf?apikey=YourApiKeyHere > output.pdf

编辑: 该命令确实有效,但与 URL found here

但是,如果我对大于 9MB 的文件执行相同操作,curl 进度表显示当前上传的字节数在不到 10 秒后停止增长,Xferd 字段表明它已经上传了一些东西9000k(在下例中为 9120k)。最终,连接似乎每次在 2 分钟 17 秒后停止(一次 2:16,使用不同的 >25Mb 文件测试 3 次),输出如下或类似:

21 41.5M 0 0 21 9120k 0 67800 0:10:42 0:02:17 0:08:25 0 * Closing connection 0 curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104

错误代码 56 显然意味着 "connection reset by peer",但这发生在上传停止两分钟后,因此服务器端对问题的正确反应似乎是不要无限期地等待上传继续。

由于类似的上传在使用浏览器表单时一直没有问题,所以应该不是浏览器配置的问题,而是我的要求。

由于我对 curl 不是很熟悉,而且我的搜索没有提供任何关于如何使用 -F 上传大型二进制文件的真正见解,我不确定我应该如何更改请求。

我在这里发现了类似的问题,但问题似乎取决于服务器。

问题似乎是由使用 URL (which is found here), instead of the non secure http:// form (such as the one used here) 的安全 https:// 形式引起的。所以问题中显示的命令形式实际上可以正常工作:

    curl -v -F file=@"filename.pptx" http://do.convertapi.com/PowerPoint2Pdf?apikey=YourApiKeyHere > output.pdf