Hi
I would like to ask, why when i try to open file , that has been sent -
its empty. Size of sent file is proper, but for example when it's pdf -
acrobat reader says " file might be damaged"
Here is my send finction
try
{
if (Client.Connected)
{
this.Text = "Sending File";
String line = null;
file = new FileStream(sfName, FileMode.Open);
fileLength = file.Length;
Client.Client.Send(fName, 0, fName.Length,
SocketFlags.None);
int BytesCount = 0;
mylegth = fileLength / 100;
long i = 0;
this.smoothprogressBar1.Value = 0;
byte[] buffer = new byte[64];
BytesCount = file.Read(buffer, 0, 64);
while ((BytesCount != 0))
{
i += Client.Client.Send(buffer);
this.smoothprogressBar1.Value = (int) ((i *
100)/ fileLength);
BytesCount = file.Read(buffer,0,64);
}
file.Close();
Client.Close();
}
this.Dispose();
}