Does anyone know, or better yet have an example, of a WCF service that will accept a form post encoded multipart/form-data
ie. a file upload from a web page?
I have come up empty on google.
Ta, Ant
Does anyone know, or better yet have an example, of a WCF service that will accept a form post encoded multipart/form-data
ie. a file upload from a web page?
I have come up empty on google.
Ta, Ant
I don't exactly know what you're trying to accomplish here, but there's no built-in support in "classic" SOAP-based WCF to capture and handle form post data. You'll have to do that yourself.
On the other hand, if you're talking about REST-based WCF with the webHttpBinding, you could certainly have a service methods that is decorated with the [WebInvoke()] attribute which would be called with a HTTP POST method.
The URI template would define the URI to use where the HTTP POST should go. You'd have to hook that up to your ASP.NET form (or whatever you're using to actually do the post).
For a great introduction to REST style WCF, check out Aaron Skonnard's screen cast series on the WCF REST Starter Kit and how to use it.
Marc
So, here goes...
Create your service contract which an operation which accepts a stream for its only parameter, decorate with WebInvoke as below
Create the class...
And the config, to accept streamed data, and the maximum size
Also in the System.Web increase the amount of data allowed in System.Web
This is just the basics, but allows for the addition of a Progress method to show an ajax progress bar and you may want to add some security.