I need a WCF Service to upload large files by user.
Which one of the below gives a more optimized performance
[OperationContract]
public void UploadFile(Stream inputsreaam);
or
[OperationContract]
public void UploadFile(byte[] buffer);
any other suggestions are welcome
If you want to upload really large files, use the Stream one. If you transfer a 2 Gb file as byte[] this will be loaded to memory on the server and only than you can save it somewhere. With the Stream you can read from client stream and write to file or DB stream on the server with only small chunks of data actually in memory. Back to performance: with really large files and multiple clients byte[] is likely to freeze your server for lack of memory.
You may also find this tutorial helpful.