Sending file through wcf
This Article trying solve this issue using WCF and TCP and streaming, in this artical will build the client and server at the end we will be able to send 75 MB file in less then 12 seconds. The receiver will provide the sender with one simple method named Put this method will take a FileTransferRequest object, as you can see in the code:. The method Put will take a FileTransferRequest object and it will call the method SaveFileStream witch will talk the file content as byte and converted into stream then save it to given folder path , here's how the FileTransferRequest look like:.
Before I call the SaveStream method I'm just make a simple check that the content file is not null and the name is set:.
I return a FileTransferResponse to tell the Put method that file is valed, so it can start wrting:. Finally you need to steup the config file of the receiver.
Sign in Email. Forgot your password? Search within: Articles Quick Answers Messages. Tagged as C. Stats Please Sign up or sign in to vote.
Download FileTransferFramework. Using the code Creating the receiver layer The receiver will provide the sender with one simple method named Put this method will take a FileTransferRequest object, as you can see in the code: C.
Copy Code. Steve Dignan Steve Dignan 7, 6 6 gold badges 27 27 silver badges 34 34 bronze badges. A very detailed and easy to follow example. Did this do it for you NagaMensch? If so I think it deserves an acceptance, no? NagaMensch, did this answer your question? Yes, this was very helpful! I ended up using a variant of this, which was a collection of Byte[]. How it work if we want to pas multiple files as stream,please take look at main question and the Issue.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses.
Windows Communication Foundation, Serialization, and Networking. Sign in to vote. Hi, We are developing a application web which purpose is to send a customer information file to companies and receive files from companies.
The file format can be anything , and size in MBs Our customers compaines are using different kind of systems, some receive this this 'file' via email or upload to a FTP location. Question s : 1. How we can implement WCF in this case?
Please explain me clearly as I am new to WCF. How effecient and what it can do better than a webservice The web application is to set and design some rules for the files like ordering and formatting, what needs to send etc etc Thanks VG. Saturday, February 14, PM. Sunday, February 15, AM.
0コメント