Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2006

Tip: Looking for answers? Try searching our database.

FtpWebRequest

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arne - 28 Jan 2006 21:56 GMT
Can you find anything wrong with the code below? It blows up in  io =
request.GetRequestStream.
It worked fine with one FTP server and not with another.  

Dim request As FtpWebRequest
           Dim password As String
           Dim response As FtpWebResponse
           password = ConfigurationManager.AppSettings("ftppwd")
           request = WebRequest.Create(FTPlocation.Text)
           request.Method = WebRequestMethods.Ftp.UploadFile
           request.Credentials = New NetworkCredential(FTPAccount.Text,
password)
           Dim io As Stream
           buff = out.ToString
           Dim b As Byte()
           b = Encoding.ASCII.GetBytes(buff)
           request.ContentLength = b.Length
           io = request.GetRequestStream
           io.Write(b, 0, b.Length)
           io.Close()
Vadym Stetsyak - 29 Jan 2006 11:12 GMT
It will be greatly helpful if you will tell the exception message that is
thrown

Signature

Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

> Can you find anything wrong with the code below? It blows up in  io =
> request.GetRequestStream.
[quoted text clipped - 16 lines]
>            io.Write(b, 0, b.Length)
>            io.Close()
Arne - 30 Jan 2006 16:16 GMT
System.Net.WebException: The remote server returned an error: 227 Entering
Passive Mode (209,98,235,43,4,4) . ---> System.Net.Sockets.SocketException: A
connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond at

> It will be greatly helpful if you will tell the exception message that is
> thrown
[quoted text clipped - 19 lines]
> >            io.Write(b, 0, b.Length)
> >            io.Close()
Vadym Stetsyak - 30 Jan 2006 17:38 GMT
Hmm, it seems that remote server didn't allow you to connect to it. There
can be a lot of reasons why remote server refused connection.

To get more details about this situation it will be a good idea to enable
network tracing and see what network I/O is happening.

See, the details at

( http://msdn2.microsoft.com/a6sbz1dx.aspx )
Signature

Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

> System.Net.WebException: The remote server returned an error: 227 Entering
> Passive Mode (209,98,235,43,4,4) . --->
> System.Net.Sockets.SocketException: A
> connection attempt failed because the connected party did not properly
> respond after a period of time, or established connection failed because
> connected host has failed to respond at
Arne - 30 Jan 2006 18:46 GMT
Vadym,
I can connect fine with a program called LeechFTP. I can't connect with a
program. I can't connect with a response file and command line ftp.

> Hmm, it seems that remote server didn't allow you to connect to it. There
> can be a lot of reasons why remote server refused connection.
[quoted text clipped - 11 lines]
> > respond after a period of time, or established connection failed because
> > connected host has failed to respond at
Vadym Stetsyak - 31 Jan 2006 09:35 GMT
That is why I've recommended you to use network tracing functionality.
It can be configured so that you can log all the traffic between your app
and
remote FTP server. Having this info you can determine the reason (analyze
traffic log), why FTP server
refuses connection.

Signature

Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

> Vadym,
> I can connect fine with a program called LeechFTP. I can't connect with a
[quoted text clipped - 17 lines]
>> > because
>> > connected host has failed to respond at

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.