开发者

best practices for download big files using WCF and ASP.NET

I Have this architecture:

WebSite ASP.NET <------> WCF Service <--------> DataBase

DAtabase gathering very big files.

User request a big file in aspx page, through WCF Service. Service call database, and get th开发者_StackOverflow社区e big file.

Now, my entity (datacontract) has those fields:

string Data1
string Data2
string Data3
byte[] FileBigger

How to send big file throught WCF Service to Website ? which best practices for do it ?


I would recommend this article from MSDN:

Large Data and Streaming

When you have a large amount of data to transfer, the streaming transfer mode in WCF is a feasible alternative to the default behavior of buffering and processing messages in memory in their entirety.

Sample Code from MSDN.

The Stream sample demonstrates the use of streaming transfer mode communication. The service exposes several operations that send and receive streams.


Check MSDN: Streaming Message Transfer out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜