title: Is WCF or Web API best for file upload using streams (large files) in a windows service (Self host, not IIS)
body: <p>I need to implement a file upload service, which may include some larger files. I initially used a WCF service and was using non streamed (i.e. I sent a byte[]), but would get out of memory exception (reading a file into the byte[] on the client).</p>
  
  <p>I then tried using Streams in the WCF. This seemed to work fine for large files, but the huge restriction is that you seem to need to only send the Stream by itself. I don't seem to be able to also send the file metadata (e.g. filename, timestamp etc)</p>
  
  <p>This service may have many client apps uploading, so I can't really see how to match up file meta data sent in a separate call to just a stream with no other information.</p>
  
  <p>I am wondering if Web API may be a better way. I haven't tried it yet, but in some samples I have seen, you appear to be able to send other data along with the stream.</p>
  
  <p>If using Web API, it will be <em>self hosted</em> (not running, in IIS, it will be running in a Windows service).</p>
  
  <p>So, to me it is starting to look like Web API may be a better choice here? Or is there a way to send metadata with a file Stream in WCF?</p>
  
  <p>Thanks in advance for any ideas!</p>