Click here to Skip to main content
15,894,896 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
Rod Kemp6-Apr-10 3:14
Rod Kemp6-Apr-10 3:14 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
EvanSaunders6-Apr-10 3:27
EvanSaunders6-Apr-10 3:27 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
Rod Kemp6-Apr-10 4:32
Rod Kemp6-Apr-10 4:32 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
EvanSaunders6-Apr-10 20:30
EvanSaunders6-Apr-10 20:30 
AnswerRe: Sending Large Files in C# using TCP Client/Server Pin
Luc Pattyn6-Apr-10 2:31
sitebuilderLuc Pattyn6-Apr-10 2:31 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
EvanSaunders6-Apr-10 2:41
EvanSaunders6-Apr-10 2:41 
AnswerRe: Sending Large Files in C# using TCP Client/Server Pin
Luc Pattyn6-Apr-10 3:16
sitebuilderLuc Pattyn6-Apr-10 3:16 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
EvanSaunders6-Apr-10 3:30
EvanSaunders6-Apr-10 3:30 
Thank you so much for the insight, will be sure to use that. Smile | :)

I have been working on solution with the help of Rod Kemp.
Basically just streaming the file across. Not certain about the efficiency of the code, but at this point, just getting something to work spot on is my aim.

Server: Sends
System.IO.FileStream inFile = new System.IO.FileStream(theCompressedFile, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] binaryData = new Byte[inFile.Length];
                
long bytesRead = inFile.Read(binaryData, 0, (int)inFile.Length);
inFile.Close();
                               
serverStream.Write(binaryData, 0, binaryData.Length);
client.Close();


Client: Recieves
FileStream fs = new FileStream(theFileName, FileMode.Create, FileAccess.ReadWrite);
BinaryWriter bw = new BinaryWriter(fs);

byte[] theFile = new byte[1024];
while (clientStream.Read(theFile, 0, 1024) > 0)
{
   bw.Write(theFile);
   theFile = new byte[1024];
}

fs.Close();
bw.Close();


Thanks again for the response!
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
Luc Pattyn6-Apr-10 3:36
sitebuilderLuc Pattyn6-Apr-10 3:36 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
EvanSaunders6-Apr-10 3:54
EvanSaunders6-Apr-10 3:54 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
Luc Pattyn6-Apr-10 4:05
sitebuilderLuc Pattyn6-Apr-10 4:05 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
EvanSaunders6-Apr-10 4:14
EvanSaunders6-Apr-10 4:14 
GeneralRe: Sending Large Files in C# using TCP Client/Server Pin
hussien ahmmed20-Sep-11 16:53
hussien ahmmed20-Sep-11 16:53 
QuestionHow to create an installer for Excel Plug In Pin
Ashish_Sood5-Apr-10 22:58
Ashish_Sood5-Apr-10 22:58 
AnswerRe: How to create an installer for Excel Plug In Pin
Eddy Vluggen5-Apr-10 23:15
professionalEddy Vluggen5-Apr-10 23:15 
GeneralRe: How to create an installer for Excel Plug In Pin
Ashish_Sood6-Apr-10 2:21
Ashish_Sood6-Apr-10 2:21 
GeneralRe: How to create an installer for Excel Plug In Pin
Eddy Vluggen6-Apr-10 3:01
professionalEddy Vluggen6-Apr-10 3:01 
QuestionHow to retrieve last application startup time Pin
Rikq5-Apr-10 22:17
Rikq5-Apr-10 22:17 
AnswerRe: How to retrieve last application startup time Pin
Mycroft Holmes5-Apr-10 22:36
professionalMycroft Holmes5-Apr-10 22:36 
AnswerRe: How to retrieve last application startup time Pin
Luc Pattyn6-Apr-10 2:30
sitebuilderLuc Pattyn6-Apr-10 2:30 
AnswerRe: How to retrieve last application startup time Pin
PIEBALDconsult6-Apr-10 4:37
mvePIEBALDconsult6-Apr-10 4:37 
QuestionError While Large File Uploading Pin
sjs4u5-Apr-10 21:08
sjs4u5-Apr-10 21:08 
QuestionStore and retrieve list of structures Pin
Reza Shojaee5-Apr-10 19:44
Reza Shojaee5-Apr-10 19:44 
AnswerRe: Store and retrieve list of structures Pin
Eddy Vluggen5-Apr-10 22:13
professionalEddy Vluggen5-Apr-10 22:13 
Questionhow to get the row index value in datagridview Pin
crisjala5-Apr-10 17:27
crisjala5-Apr-10 17:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.