【发布时间】:2023-03-26 20:55:01
【问题描述】:
我正在尝试上传到 apache2 服务器。我有一个基于 python 的应用程序,它使用类似
的代码import requests
files = {'userfile': open('sty.png', 'rb')}
r = requests.put('http://localhost/upload/upload_file.php',files=files)
print r.text
PHP 以上传文件的最终地址作为响应。 在 HTML 的帮助下执行此操作正在使用 $_FILES 参数。 这是显示错误
【问题讨论】:
-
显示什么错误?
-
不显示任何错误。当我将一些字符串作为 POST 参数传递时它可以工作,但对于文件它直接进入异常处理部分
-
它会引发什么异常?它包含什么信息?
标签: php python post request forms http-post