I probably would have changed this
byte[] buffer = new byte[stream.Length];
int bytesSize = 0;
reqStream = request.GetRequestStream();
while ((bytesSize = stream.Read(buffer, 0, buffer.Length)) > 0)
{
reqStream.Write(buffer, 0, bytesSize);
this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { bytesSize, stream.Length });
}
to
byte[] buffer = new byte[1024];
int bytesSize = 0;
reqStream = request.GetRequestStream();
do
{
bytesSize = stream.Read(buffer,0,buffer.Length)
reqStream.Write(buffer,0, bytesSize);
this.Invoke(new UpdateProgressCallback(this.UpdateProgress),new object[] {bytesSize, stream.Length });
}
while (bytesSize != 0);