Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help with FtpWebRequest (UploadFile status/progress)

Reply
Thread Tools

Help with FtpWebRequest (UploadFile status/progress)

 
 
Dan
Guest
Posts: n/a
 
      01-07-2010
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with FtpWebRequest brian ASP .Net 1 03-07-2009 01:22 AM
FTPWebRequest failing - URGENT BizWorld ASP .Net 1 06-15-2007 07:34 PM
Passing DefaultCredentials to an FtpWebRequest =?Utf-8?B?QmlsbA==?= ASP .Net 0 03-21-2007 08:45 AM
FTPWebRequest File.ReadOpen Could Not Find File jlacefie@gmail.com ASP .Net 2 02-12-2007 09:41 PM
How to keep session in FtpWebRequest Darqer ASP .Net 1 11-06-2006 05:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57