Reputation: 1387
In our solution we have a winforms client and a web application with a database. We use WCF as the main way to communicate and perform certain actions on the server and all works well but now we need to implement a way to download fairly large files (~ couple of 100MB) under conditions that need to be validated on the server side (otherwise bypassing the client would enable unconditional downloads).
The most obvious and desirable solution (at least for the validation part) is a WCF service. But for downloading files configuration seems quite involved when it comes to large files, and there are important settings and options that I would not be comfortable to deploy without fully understanding them.
With WebRequest or WebClient I cannot see any way to perform validation on the server.
Is there any simple way to achieve this?
If WCF is the way can anyone show me how to implement this correctly and safely?
Upvotes: 0
Views: 115
Reputation: 2286
WCF allows to stream response so you can use it to download large file/data set. Please read this article to learn how to work with streaming. The same but in another words and with sample code: Streaming files over WCF
Upvotes: 1