Python:通过请求过快上传文件?

时间:2017-06-27 17:27:38

标签: python file upload

我注意到我写的脚本"上传"文件非常快......我有500kbs的上传速度,所以绝对不可能在2分钟内上传1GB文件。

上传代码:

with open(local_path, 'rb') as f:
    files = MultipartEncoder({'files[]': (filename, f, 'application/octet-stream')})
    UploadFile = requests.post(self.UploadURL, data=files, allow_redirects=False, headers={'Content-Type': files.content_type})

我使用了名为" Fiddler4"要查看正在传输的数据量,此外,此上传代码可以正常使用1-100MB文件,但1GB文件会导致服务器关闭连接,因此我收到[Errno 32] Broken Pipe错误

0 个答案:

没有答案
相关问题