These days because you want to call the Java interface so to transfer files I chose the curl file, this side said a pit, I was in the file transfer time with the original @ behind directly plus the file absolute path.
However, there has been no error in the feeling has not been sent out, and then I used the win under the test, directly throw a warning that this method is outdated, please use the Curlfile function instead. Until now I know that the original is their own computer has not opened a warning error, win under I have been open, this problem for a long time.
Here's the code to see Curl transfer files and array data,
$beforePath = '/applications/mamp/htdocs/photo/1.jpg '; $afterPath = '/applications/mamp/htdocs/photo/2.jpg ';//absolute path $data = [ ' top ' + = Curl_file_create ($ Beforepath), ' after ' = Curl_file_create ($afterPath), ' partnerid ' and ' = ' $data [' 0 '] [' uid '], ' mobile ' = = $data 1[' 0 ' [' phone '], ' email ' and ' $data 1[' 0 ' [' email '], ' realname ' + $data [' 0 '] [' real_name '], ]; curl_setopt ($ch, Curlopt_ssl_verifyhost, FALSE); Disable Certificate curl_setopt ($ch, Curlopt_ssl_verifypeer, FALSE); curl_setopt ($ch, Curlopt_header, false); curl_setopt ($ch, Curlopt_post, true); curl_setopt ($ch, curlopt_binarytransfer,true); curl_setopt ($ch, Curlopt_postfields, $data); curl_setopt ($ch, Curlopt_url, $url); $info = curl_exec ($ch); Curl_close ($ch);
The above describes the curl high-low version of the transfer file, including the content, I hope that the PHP tutorial interested in a friend helpful.