title: Sending a image file using a socket in C# (Large Data)
body: <p>i want to send a large data (image) approx . <strong>1MB</strong> file  though a socket connection</p>
  
  <p><strong>Question 1</strong></p>
  
  <p>following code snippet of the socket client which i currently use to send a a text message .. how i can modify this to send a file ? </p>
  
  <pre><code> NetworkStream serverStream = clientSocket.GetStream();
      byte[] outStream = System.Text.Encoding.ASCII.GetBytes(richTextBox1.Text+"$");
      serverStream.Write(outStream, 0, outStream.Length);
      serverStream.Flush();
  </code></pre>
  
  <p><strong>Question 2</strong> : What modifications that required in both socket client and server to send and get large files ? </p>