title: Sending a byte array from PHP to WCF
body: <p>I have to send a byte array (encoded photo) from my PHP client to the WCF host. when I do a var_dump() on my array in PHP I get an array[2839] which is ok but on the server side when I debug I see that received array is only byte[5]... Any idea how I can fix it?</p>
  
  <p>I used code like this</p>
  
  <pre><code>$file = file_get_contents($_FILES['Filedata']['tmp_name']);
          $byteArr = str_split($file);
          foreach ($byteArr as $key=&gt;$val) { $byteArr[$key] = ord($val); }
  
  $client = new SoapClient('http://localhost:8000/MgrService?wsdl',
                      array(
                      'location' =&gt; 'http://localhost:8000/MgrService/SOAP11',
                      'trace' =&gt; true,
                      'soap_version' =&gt; SOAP_1_1
                      ));
    $par1-&gt;profileId = 13;
    $par1-&gt;photo = $byteArr;          
  
    $client-&gt;TestByte($par1);
  </code></pre>
  
  <p>And as I wrote earlier on the wcf host I get only byte[5] :/ maybe it needs some decoding to right soap serialize? should I use Base64 decoding or something?</p>
  
  <p>General I just want to upload posted file to c# function with byte[] as parameter :/ Help</p>
  
  <p>Oh and the wsdl part of this function looks like this</p>
  
  <pre><code>&lt;xs:element name="TestByte"&gt;
  &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
  &lt;xs:element minOccurs="0" name="photo" nillable="true" type="xs:base64Binary"/&gt;
  &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>