title: Displaying progress while uploading data
body: <p>I am using the following code located <a href="http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx" rel="nofollow">here</a> to upload files</p>
  
  <pre><code>Public Function UploadFile(ByVal oFile As FileInfo) As Boolean
  Dim ftpRequest As FtpWebRequest
  Dim ftpResponse As FtpWebResponse
  Try
  ftpRequest = CType(FtpWebRequest.Create(FTPSite + CurrentDirectory + oFile.Name), _
      FtpWebRequest)
  ftpRequest.Method = WebRequestMethods.Ftp.UploadFile
  ftpRequest.Proxy = Nothing
  ftpRequest.UseBinary = True
  ftpRequest.Credentials = New NetworkCredential(UserName, Password)
  ftpRequest.KeepAlive = KeepAlive
  ftpRequest.EnableSsl = UseSSL
  If UseSSL Then ServicePointManager.ServerCertificateValidationCallback = _
      New RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)
  Dim fileContents(oFile.Length) As Byte
  Using fr As FileStream = oFile.OpenRead
  fr.Read(fileContents, 0, Convert.ToInt32(oFile.Length))
  End Using
  Using writer As Stream = ftpRequest.GetRequestStream
  writer.Write(fileContents, 0, fileContents.Length)
  End Using
  ftpResponse = CType(ftpRequest.GetResponse, FtpWebResponse)
  ftpResponse.Close()
  ftpRequest = Nothing
  Return True
  Catch ex As WebException
  Return False
  End Try
  End Function
  </code></pre>
  
  <p>I would like to extend it, so i can have an upload progress too.
  The problem is that i do not know from where to start.
  What is the "logic" of displaying the upload progress?</p>
  
  <p>"Split the file" in predefined parts and upload them or what?</p>