【问题标题】:How to send file via HTTP from .NET app to PHP web page?如何通过 HTTP 从 .NET 应用程序将文件发送到 PHP 网页?
【发布时间】:2013-11-14 03:44:50
【问题描述】:

桌面.NET 应用通过HTTP 将文件发送到PHP 网页的最佳方式是什么?

.NET 应用可以使用此代码上传文件:

using(WebClient client = new WebClient()) {
    client.UploadFile(address, filePath);
}

PHP 页面中简单地添加此文件是否允许上传文件?

file_put_contents(filename, file_get_contents('php://input'));

【问题讨论】:

    标签: php .net http webclient


    【解决方案1】:

    这是对我有用的PHP 代码,而不是问题中的内容:

    move_uploaded_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"]);
    

    【讨论】:

      猜你喜欢
      • 2012-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-13
      • 1970-01-01
      • 2015-10-07
      • 2023-03-16
      相关资源
      最近更新 更多