I got a WCF
service with a method to receive files, looking something like this
public bool UploadFile(string fileName, byte[] data)
{
//...
}
What I'd like to do is to post the data to this method in the WCF service from PHP, but are unaware if it's even possible to post byte arrays from PHP to a .NET method hosted by a WCF service.
So I was thinking of something like this
$file = file_get_contents($_FILES['Filedata']['tmp_name']); // get the file content
$client = new SoapClient('http://localhost:8000/service?wsdl');
$params = array(
'fileName' => 'whatever',
'data' => $file
);
$client->UploadFile($params);
Would this be possible or are there any general recommendations out there I should know about?