Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65491

Passing file from web page to wcf service

We have a asp.net page where the user is allowed to upload a file.

This file is then sent on to a back end system via a wcf services.

Currently we read the file into a byte array and then send an object into the wcf service where the byte array is a property.

This works fine, but we are wondering if there is a more efficient way to do it?

Upvotes: 0

Views: 1372

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039538

You could use MTOM which is specifically designed for exchanging binary files because it avoids the overhead of XML serialization. In the example I've linked to a byte array is returned from a WCF operation but you could use it as input argument as well.

Upvotes: 1

Related Questions