Search code examples
c#.netwcfupload

upload file wcf


I'll create an WCF for uploading file such as images or pdf files to te server. How can I create a service that can handle this function ? I tried to googling about it, but most of article told me to use Stream as service parameter. But what I want is using byte[] (array) for the file content. because, this service is not only accessing using .nte framework, but also using other technologies, such as php, java, objective-c, etc.

any helps ?


Solution

  • Seems streaming is your only option. See this [MSDN example]

    See this question : How to upload a file to a WCF Service?

    You could check out this article: http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx

    It talks about just setup WCF Service for receiving arbitrary data, and you can POST from any client (php,java etc)