Question FTP in console application - "Operation timed out" error

sugants

New member
Joined
Aug 18, 2008
Messages
4
Programming Experience
1-3
Hi,

I'm uploading files to the FTP server in .net 3.5 using FTPwebrequest class.
My Code works fine when i try to upload the files through web application.
Pls find the code below:
VB.NET:
Dim ftp As Net.FtpWebRequest = FtpWebRequest.Create(Uri)
ftp.Method = Net.WebRequestMethods.Ftp.UploadFile
ftp.UseBinary = False
ftp.ContentLength = fi.Length
Dim streamobj As FileStream = File.OpenRead(fi.FullName)
Dim buffer(streamobj.Length) As Byte
streamobj.Read(buffer, 0, buffer.Length)
streamobj.Close()
streamobj = Nothing
ftp.GetRequestStream.Write(buffer, 0, buffer.Length)
Now, I have created a windows application and when i try to upload 2 files it is working fine. But when i try to upload more than 2 files, I am getting "Operation has timed out" error message.

Ne suggestions?
:confused:
 
Last edited by a moderator:
Back
Top