From: Dan on
Hi,
I have implemented a code to send file to our server using FTP, and it is
working.
But the issue is I have no idea when the process will complete sending.
Is there any way to know how much has been sent to the server or any event I
can trap when the process ends.
Below is the sample code I am using.

Dim reqObj As FtpWebRequest =
WebRequest.Create("ftp://SomeIP/FileName.txt"))

reqObj.Credentials = New NetworkCredential("something", "something")
reqObj.Method = WebRequestMethods.Ftp.UploadFile

Dim streamObj As IO.FileStream = System.IO.File.OpenRead(FileName)
Dim buffer(streamObj.Length) As Byte

streamObj.Read(buffer, 0, buffer.Length)
streamObj.Close()
streamObj = Nothing
reqObj.Proxy = Nothing

reqObj.GetRequestStream().Write(buffer, 0, buffer.Length)
reqObj = Nothing

Please guide with an example or link.

Thanks in advance.
Dan