Post 来自命令提示符的文件

Post file from Command Prompt

我正在处理一个批处理脚本,它可以进行 SQL 查询并将其保存到文件中。然后该文件将由 PHP 处理。是否有可能 POST 从 Windows CMD 到 PHP 站点的文件,以便它可以由 php 和 $_FILES['someFile'] 处理?

是的,您可以为此使用 curl

curl -F someFile=@localfile.sql http://example.org/upload

或者您可以使用 wget.

wget --post-file=file.jpg http://yourdomain.com/target.php