ASP.NET MVC upload file to a web service


There was a requirement from the client to upload a file from a asp.net mvc page to a web service. The following code is not meant to be complete but it will give you the main idea how to implement an uploder in javascript integrated with the ASP.NET MVC and a SOAP web service.

The cshtml was rendered in this way:

The javascript button handler:

The SOAP web service can be decorated in this way:

 

And the implementation in C# looks like this:

 

Leave a comment

Your email address will not be published. Required fields are marked *