title: Can an ASP MVC controller action receive a byte[]?
body: <p>I have an ASP MVC application which I also use (as a requirement) as a web service for a mobile application.</p>
  
  <p>I have a controller handeling most of the actions used by the mobile app returning json, which works fine.</p>
  
  <p>But I'm not sure of how to handle the upload of a picture as byte[]. </p>
  
  <p>Can a controller action receive a byte[] ?</p>
  
  <p>I was thinking of encoding the byte[] into a string and then decoding it back in the controller action.</p>
  
  <p>But I tried the conversion back and forth but the new byte[] is always different from the or original byte[] </p>
  
  <pre><code>byte[] originalData = ... // picture as byte[]
  string dataString = System.Text.Encoding.Unicode.GetString(data);
  byte[] newData = System.Text.Encoding.Unicode.GetBytes(dataString); 
  </code></pre>
  
  <p>Is there a beter way or should I just go ahead and receive directly the simple byte[] ??</p>