简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM