gpt4 book ai didi

c# - 通过 http 下载文件不起作用但通过 https 工作正常

转载 作者:可可西里 更新时间:2023-11-01 16:10:35 26 4
gpt4 key购买 nike

我有以下场景从服务器下载文件:

  • 我试图在 ASP.NET 页面中通过 HTTP(但不是 SSL)从服务器下载许多文件,但其中一个文件没有下载;它返回错误:操作超时

  • 当我尝试通过 HTTPS 下载此文件时,它运行良好。

  • 我尝试使用其他软件使用纯 HTTP 下载文件,但我收到了相同的错误消息。

我非常感谢任何指导或帮助。

最佳答案

if (The file is executable file )

May be because the web server for some EXE files resides on doesn't send a
Content-Length header. If this header is absent, the only way you can determine if the download is complete is "when the bytes stop coming", i.e. the TCP/IP connection is closed or times out. If the connection quality is low, this may very well happen prematurely.

But why this not happened in Https? Thats because http has bigger waiting time and smaller receiving time. https on the other hand has smaller waiting time and bigger receiving time.

The http port on the shared hosting server is more busy, thus a request stays longer in the queue until is accepted by the server.

On the https port there is less traffic on the server so the request is serviced faster.

关于c# - 通过 http 下载文件不起作用但通过 https 工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5926807/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com