使用cURL -F的Powerpoint上传停止在〜9MB [英] Powerpoint upload stops at ~9MB with cURL -F

查看:127
本文介绍了使用cURL -F的Powerpoint上传停止在〜9MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当上传大于9MB的文件时,使用ConvertApi.com PowerPoint2Pdf转换时出现问题.我可以通过浏览器表单上载至少43MB的PowerPoint文件,而不会出现问题,因此,这不应是API的限制.

如果尺寸小于此尺寸,则当我使用此行时,转换将非常完美地进行卷曲(应用这些说明,进行适当的更改):

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

该命令确实有效,但是与URL 在此处找到

但是,如果我对大于9MB的文件执行相同的操作,则卷曲进度表会显示当前上传的字节数在少于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显然意味着对等方重置了连接",但是这种情况发生在上传暂停后超过两分钟,因此对于服务器端的问题,这似乎是一个健康的反应,不要无限期地等待上传以继续.

由于类似的上载在使用浏览器表单时始终可以正常工作,因此浏览器配置应该不成问题,而是我的要求.

由于我对curl不太熟悉,而且我的搜索也没有提供有关如何使用-F上传大型二进制文件的任何真知灼见,因此我不确定应该如何更改请求.

我在这里发现了类似的问题,但是问题似乎取决于服务器. PHP/CURL/ASP.NET/C#-发送大于9mb的文件

解决方案

问题似乎是由于使用安全的https://形式的URL(

I have a problem using ConvertApi.com PowerPoint2Pdf conversion, when uploading files that are larger than 9MB. I can upload at least 43MB PowerPoint files through the browser form without problems, so it should not be a restriction in the API.

If the size is less than this, the conversion works with curl perfectly fine, when I use this line (Applying these instructions, with the appropriate changes):

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

Edit: That command actually works, but it was broken when combined with the URL found here

However, if I do the same with a file larger than 9MB, the curl progress meter shows that the currently uploaded amount of bytes stops growing after less than 10 seconds, with the Xferd field indicating that it has uploaded something around 9000k (in the example below, it is 9120k). Eventually the connection seems to stop every time after 2min 17s (once 2:16, tested 3 times with different >25Mb files), with the following output, or similar:

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

The error code 56 means apparently "connection reset by peer", but this happens more than two minutes after the upload has halted, so it seems to be a healthy reaction to the problem from the server side not to wait indefinitely for the upload to continue.

As the similar upload works consistently without problems when using the browser form, it should not be a problem with the browser configuration, but rather with my request.

As I am not very familiar with curl, and my searches didn't provide me any real insights in how to upload large binary files using -F, I am not sure how I should change the request.

I found a similar problem here, but there the problem seems to have been something depending on the server. PHP / CURL / ASP.NET / C# - Send files bigger than 9mb

解决方案

The problem seems to be caused by using the secure https:// form of the URL (which is found here), instead of the non secure http:// form (such as the one used here). So the form of the command as shown in the question actually works correctly:

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

这篇关于使用cURL -F的Powerpoint上传停止在〜9MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆