i want to do the following :-
transfer file from client to server using sockets in a windows based application.
I am stuck at the server side code.
Server side :
-------------
my problem : how to receive file from multiple clients and save file on server c:\folder
following is the
Client side code
------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Net.Sockets;
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofpd = new OpenFileDialog();
ofpd.ShowDialog();
textBox1.Text = ofpd.FileName;
}
private void button2_Click(object sender, EventArgs e)
{
Stream Fs = File.OpenRead(textBox1.Text);
Byte[] buffer = new Byte[Fs.Length];
Fs.Read(buffer, 0, buffer.Length);
TcpClient socket = new TcpClient(“Localhost”, 1095);
NetworkStream nw = socket.GetStream();
nw.Write(buffer, 0, buffer.Length);
nw.Close();
}
Please help me.. Thanks in advance..