5
Vote

Sending big files by WCF Service to ASP.NET or WinForms application

description

For example, send big file (more than 500MB like PDF file, or big JPG files) by WCF Service to a ASPNET application and too for WinForms application.
 
Have this architecture:
 
WebSite ASP.NET <------> WCF Service <--------> DataBase
 
or
 
WinForms application <------> WCF Service <--------> DataBase
 
DAtabase gathering very big files.
 
User request a big file in aspx page, through WCF Service. Service call database, and get the 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 ?
 
How to send big file throught WCF Service to winForms ?
 
which best practices for do it ?
 
Very good sample is required.

file attachments

comments

MariusVanBelkum wrote Feb 7, 2011 at 9:30 AM

Hi There,

I have create a small applications that uses a webservice that allows you to stream a file to or from the web service.

Streaming is enabled on the web service. Here is 2 links if you would want read up on it:

http://msdn.microsoft.com/en-us/library/ms731913.aspx
http://msdn.microsoft.com/en-us/library/ms733742.aspx

Regards
Marius van Belkum

mapeng wrote Aug 31, 2012 at 4:20 AM

Hello alhambraeidos,

Thank you for using our free Microsoft All-In-One Code Framework Sample Request Service!

Your sample request is about how to use the WCF Service to send the big Files. If I misunderstood your requirement, please feel free to let me know.

You can refer the MariusVanBelkum’s link, and if you want the sample, you can refer the following link: http://code.msdn.microsoft.com/Streaming-Photo-OData-7feb9239.
This sample demonstrates how to use WCF Data Services to implement an OData service that uses a streaming provider to store and retrieve image files.

Please let us know if this sample is helpful to you.

Thanks and have a great day!

Microsoft All-In-One Code Framework
Feedback address: onecode@microsoft.com