且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用C#将文件上传到远程URL

更新时间:2023-01-15 11:39:14

在使用multipart-formdata时,WebClient似乎不合适. 尝试使用HttpWebRequest-Class或将上载字段的名称更改为文件".
您可以通过在脚本的开头执行print_r(
As you are using multipart-formdata the WebClient seems to be unsuitable.
Either try to use the HttpWebRequest-Class or adapt the name of the upload-field to "file".
You can test the last one by do a print_r(


_FILES)来测试最后一个.
_FILES) at the beginning of the script.