PHP SOAP Transferring Files

前端 未结 3 2030
天命终不由人
天命终不由人 2020-12-06 02:22

I am trying to learn how to transfer files (.zip files) between a client and server using PHP and SOAP. Currently I have a set up that looks something like this:

<         


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 02:34

    In client.php, change this:

    if($_POST['submit'])
    {
    
       ...
    
    }   
    $client=new soapclient($wsdl) or die("Error");   // Connect the SOAP server
    $response = $client->__call('upload_file',array($decodeContent,$filename)) or die("Error");  //Send two inputs strings. {1} DECODED CONTENT {2} FILENAME
    

    to this:

    if($_POST['submit'])
    {
       ...
    
       $client=new soapclient($wsdl) or die("Error");   // Connect the SOAP server
       $response = $client->__call('upload_file',array($decodeContent,$filename)) or die("Error");  //Send two inputs strings. {1} DECODED CONTENT {2} FILENAME
    }
    

提交回复
热议问题