Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 卷曲以“上载”文件内容_Php_File_Curl_Binary - Fatal编程技术网

Php 卷曲以“上载”文件内容

Php 卷曲以“上载”文件内容,php,file,curl,binary,Php,File,Curl,Binary,我目前正试图通过curl将一个用openssl aes加密的二进制文件的内容上传到一个php脚本中 PHP代码如下所示: if($_POST["content"] == ""){ } else{ $myfile = fopen("file.txt","w"); fwrite($myfile,$_POST["content"]); fclose($myfile); } 所以我通常会这样做: curl -d "content=<DATA>" http://www.ex

我目前正试图通过curl将一个用openssl aes加密的二进制文件的内容上传到一个php脚本中

PHP代码如下所示:

if($_POST["content"] == ""){
}
else{
   $myfile = fopen("file.txt","w");
   fwrite($myfile,$_POST["content"]);
   fclose($myfile);
}
所以我通常会这样做:

curl -d "content=<DATA>" http://www.example.com/script.php
但是,由于我有一个二进制文件,这似乎不起作用,所以我尝试了使用@symbol和via-F的curl-d,但两者都不起作用,因为我需要将ist发布到$\u post的内容部分


如何使其正常工作?

为什么要使用COMMAND line curl?为什么不在php中使用curl并在那里进行上传,而不是先写入文件?php脚本位于外部Web服务器上,curl命令在我的家用计算机上执行。这就是原因。PHP脚本应该检索culr命令上载的数据并将其保存在Web服务器上。没有人有线索吗?:/以下是答案->[使用curl命令行上载文件][1][1]: