I have seen those threads too. I don't understand the concept (I am used to doing things the hard way..think VB6 :-) ). Can you explain, please?
Main Topics
Browse All TopicsHow do you transfer files from server to client (and vice versa) using WCF?
Please provide code examples or tutorial links.
VB.net preferred in the examples.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi again,
WCF is a communication tool built on top of the .NET framework. You are simply passing the file as a byte array, there is no file handle at this point, and the communication foundation (WCF) is taking care of sending the byte array from the client to the server using an endpoint so that it knows where to send it, and using a config file and binding so that it knows how you want it sent. Once the byte array reaches the server you must take care of creating the file handle and writing out the contents of the byte array to it.
This is C# but WCF has taken care of sending the data and then you must decide what to do with it...
http://www.google.ie/searc
Taken from the above article:
string filePath = @"I:\Sabid\WCF\Downloads\"
FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
fs.Write(data, 0, data.Length);
fs.Close();
The endpoint is created so that the client knows where to send the byte array.
Let me know if you need more info,
Darren
What about this? It appears they are passing the actual stream object, which means I can loop through to the end of the stream on the server side.
http://www.codeproject.com
Is my interpretation correct?
Hi,
As the article says:
'The upload and download functions get special mention because they work with Stream objects, but as you can see, you don't do anything different with them than what you'd normally do when working with streams. You just have to create some sort of stream and pass it to the service; we have already configured our service for streamed mode, so the transfer of the data is handled appropriately for us.'
I don't see where in the article they are looping through the stream except for when it is being copied.
WCF takes care of the communication for you.
Darren
Hi,
Have you looked at the sample code from Microsoft on this?
Article:
http://msdn.microsoft.com/
'The operations GetStream, UploadStream and EchoStream all deal with sending data directly from a file or saving received data directly to a file. However in some cases, there is a requirement to send or receive large amounts of data and perform some processing on chunks of the data as it is being sent or received. One way to address such scenarios is to write a custom stream (a class that derives from Stream) that processes data as it is read or written. The GetReversedStream operation and ReverseStream class are an example of this.'
Download the sample and see if that helps, The Streaming is in the 'C:\Samples\WCFWFCardSpace
Darren
Business Accounts
Answer for Membership
by: DarrenDPosted on 2009-09-20 at 04:46:11ID: 25376837
Hi,
m/2007/02/ wcf-stream ing-upload - files-ove r-http.htm l
/KB/WCF/ WC F_FileTran sfer_Progr ess.aspx?m sg=2237368
ft.com/For ums/en-US/ wcf/thread / f00037f1- 02e1-4e1c- b6ed-03fe1 34f3460
Here is an example HTTP: C#
http://kjellsj.blogspot.co
VB & C#
http://www.codeproject.com
TCP: C#
http://social.msdn.microso
Cheers,
Darren