Help with FtpWebRequest (UploadFile status/progress)

Discussion in 'ASP .Net' started by Dan, Jan 7, 2010.

  1. Dan

    Dan Guest

    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
     
    Dan, Jan 7, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darqer
    Replies:
    1
    Views:
    1,337
    GinaM
    Nov 6, 2006
  2. Replies:
    2
    Views:
    549
  3. =?Utf-8?B?QmlsbA==?=

    Passing DefaultCredentials to an FtpWebRequest

    =?Utf-8?B?QmlsbA==?=, Mar 21, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    388
    =?Utf-8?B?QmlsbA==?=
    Mar 21, 2007
  4. brian

    help with FtpWebRequest

    brian, Mar 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    694
    bruce barker
    Mar 7, 2009
  5. Thom Little

    FtpWebRequest UploadFile

    Thom Little, Nov 13, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    550
    Steven Cheng[MSFT]
    Nov 15, 2005
Loading...

Share This Page