title: REST post request with optional file upload
body: <p>while creating WCF REST service, i am receiving data in json and able to save in database. now i need to give option to upload file(optional, image or video) with same service. i tried sending byte array but it is giving bad request error possibly because of serialization of such a long array. i read that to upload large files i need to use stream. how would i do that while sending other parameters? i am creating this service to receive data from mobile device. here is my service interface <br/></p>
  
  <pre><code>[WebInvoke(UriTemplate = "SaveFBPost", 
      Method = "POST", 
      BodyStyle = WebMessageBodyStyle.Wrapped,
      RequestFormat = WebMessageFormat.Json, 
      ResponseFormat = WebMessageFormat.Json)]
  [OperationContract]
  void SaveFacebookPost(FBPostData fbPostData);
  </code></pre>
  
  <p>public class FBPostData:</p>
  
  <pre><code>[DataMember]
  public string scheduleDate { get; set; }
  
  [DataMember]
  public string userId { get; set; }
  
  [DataMember]
  public string groupId { get; set; } 
  
  [DataMember]
  public string postText { get; set; }
  
  [DataMember]
  public byte[] file { get; set; }
  
  [DataMember]
  public string fileType { get; set; }
  
  [DataMember]
  public string accessToken { get; set; }
  </code></pre>