473,792 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I avoid ftp timout issues?

Hello, can someone please suggest to me how I can keep my ftp connection from
timing out after a large file download?

I am using SSIS and I have tried multiple ways of ftp'ing the files in my
directory to my local hard drive, but the tasks keep failing after a large
file is downloaded. The error I'm getting is:

An error occurred in the requested FTP operation. Detailed error
description: Receiving file "usfile.zip ".
The operation timed out

The file is about 120MB.

I tried using the ftp task, as well as writing (reverse engineering) an ftp
script task using FtpWebRequest.C reate and both methods work as long as the
files are small.

It looks like the ftp timeout property has to be set between 1 and 300, so
even though I am explicitly assigning a timeout property of 0 in my
connection via script, it is still timing out.

Any suggestions are much appreciated. I've been struggling with this issue
for about a week now.

Thanks!

Jason
http://www.lonestarfinancing.com

Aug 27 '08 #1
7 13772
Jason wrote:
Hello, can someone please suggest to me how I can keep my ftp
connection from timing out after a large file download?

I am using SSIS and I have tried multiple ways of ftp'ing the files
in my directory to my local hard drive, but the tasks keep failing
after a large file is downloaded. The error I'm getting is:

An error occurred in the requested FTP operation. Detailed error
description: Receiving file "usfile.zip ".
The operation timed out

The file is about 120MB.

I tried using the ftp task, as well as writing (reverse engineering)
an ftp script task using FtpWebRequest.C reate and both methods work
as long as the files are small.

It looks like the ftp timeout property has to be set between 1 and
300, so even though I am explicitly assigning a timeout property of 0
in my connection via script, it is still timing out.

Any suggestions are much appreciated. I've been struggling with this
issue for about a week now.
In addition to a timeout on the client, there is also a timeout on the server.
You may be hitting an FTP connection timeout on the server, which can be
configured on the server end of things. I have done that for HTTP, not FTP, but
Googling it should help. It may just be a property on the FTP site in IIS.

There are some places where a timeout of 0 (no limit) is not accepted, and it
reverts to the default setting. You might also try a large value instead, like
3600 seconds.
Aug 27 '08 #2
Hello Steve,

I checked microsoft's site, and you can see here that the timeout setting
must be between 1 and 300:
http://technet.microsoft.com/en-us/l...t(SQL.90).aspx.

I tried changing it to 0 or a higher value, but it doesn't look it actually
accepts any value other than between 1 and 300.
I've been googling this issue for a week now, and I'm not sure what to do.
Do you know how I can tell if the problem is on my side or on the server?

Thanks,

Jason
http://www.lonestarfinancing.com

"Steve Gerrard" wrote:
Jason wrote:
Hello, can someone please suggest to me how I can keep my ftp
connection from timing out after a large file download?

I am using SSIS and I have tried multiple ways of ftp'ing the files
in my directory to my local hard drive, but the tasks keep failing
after a large file is downloaded. The error I'm getting is:

An error occurred in the requested FTP operation. Detailed error
description: Receiving file "usfile.zip ".
The operation timed out

The file is about 120MB.

I tried using the ftp task, as well as writing (reverse engineering)
an ftp script task using FtpWebRequest.C reate and both methods work
as long as the files are small.

It looks like the ftp timeout property has to be set between 1 and
300, so even though I am explicitly assigning a timeout property of 0
in my connection via script, it is still timing out.

Any suggestions are much appreciated. I've been struggling with this
issue for about a week now.

In addition to a timeout on the client, there is also a timeout on the server.
You may be hitting an FTP connection timeout on the server, which can be
configured on the server end of things. I have done that for HTTP, not FTP, but
Googling it should help. It may just be a property on the FTP site in IIS.

There are some places where a timeout of 0 (no limit) is not accepted, and it
reverts to the default setting. You might also try a large value instead, like
3600 seconds.
Aug 27 '08 #3
In article <F1************ *************** *******@microso ft.com>, Jason
<ja*******@onli ne.nospamwrote:
Hello, can someone please suggest to me how I can keep my ftp connection from
timing out after a large file download?
FTP downloads take place on two connections, most likely your command
connection is timing out for lack of use...you might give it a kick and
send it a command every once in a while.

--
J.B. Moreno
Aug 27 '08 #4
Hello JB,

I am new to programming, but below is the code I'm using. It works until a
large file (120MB) is downloaded. Once it downloads, no other files in the
directory are downloaded, and I get an error msg saying my connection timed
out.
Can you send me an example of what I should do based on my code below?

------------
'And we obtain our file(s):

ftp.ReceiveFile s(sbDownloadFil es.ToString().S ubstring(0, _

sbDownloadFiles .ToString.Lengt h - 1).Split("|".To CharArray()), _

Dts.Variables(" FtpDestination" ).Value.ToStrin g, True, False)
-------------

Also, do I need to set KeepAlive to True? I thought is defaulted to True.

Here is my code:

------------------------------------
Public Sub Main()

Dim ftp As FtpClientConnec tion

Dim retrieveFiles As Boolean = False

Dim ftpWeb As FtpWebRequest

Try

ftpWeb = CType(FtpWebReq uest.Create("ft p://" +
Dts.Variables(" FTPURL").Value. ToString + _

"/" + Dts.Variables(" FTPDirectory"). Value.ToString) , FtpWebRequest)

ftpWeb.Credenti als = New
NetworkCredenti al(Dts.Variable s("FTPUser").Va lue.ToString,
Dts.Variables(" FTPPassword").V alue.ToString() )

ftpWeb.Method = WebRequestMetho ds.Ftp.ListDire ctoryDetails

'Using fileReader As StreamReader = File.OpenText(b aseFileName)

Dim srResponse As New StreamReader(ft pWeb.GetRespons e().GetResponse Stream())

Dim readLine As String

Dim stringComponent s() As String

Dim sbDownloadFiles As New StringBuilder()

Dim fileEnding As String = Dts.Variables(" FtpFileEnding") .Value.ToString

Dim ignoreDate As Boolean =
Convert.ToBoole an(Dts.Variable s("IgnoreDate") .Value.ToString )

While Not srResponse.EndO fStream()

readLine = srResponse.Read Line()

If readLine.Trim() .EndsWith(fileE nding) Then

stringComponent s = readLine.Split( " ".ToCharArray() )

'Since the file is updated at least once a month, we just check the day:

If ignoreDate Or Math.Abs(DateTi me.Now.Day -
Int32.Parse(str ingComponents(1 7))) < 2 Then

'This file has been modified within the last day or so...

retrieveFiles = True

sbDownloadFiles .Append(stringC omponents(19) + "|")

End If

End If

End While

srResponse.Clos e()

srResponse = Nothing

ftpWeb = Nothing

If retrieveFiles Then

'Now we need to build our FTP connection:

Dim fiRemoteFile As FileInfo

Dim ftpConnectionMa nager As ConnectionManag er

ftpConnectionMa nager = Dts.Connections .Add("FTP")

ftpConnectionMa nager.Propertie s("ServerName") .SetValue(ftpCo nnectionManager ,
Dts.Variables(" FTPURL").Value)

ftpConnectionMa nager.Propertie s("ServerPort") .SetValue(ftpCo nnectionManager ,
Dts.Variables(" FTPPort").Value )

ftpConnectionMa nager.Propertie s("ServerUserNa me").SetValue(f tpConnectionMan ager, Dts.Variables(" FTPUser").Value )

ftpConnectionMa nager.Propertie s("ServerPasswo rd").SetValue(f tpConnectionMan ager, Dts.Variables(" FTPPassword").V alue)

ftpConnectionMa nager.Propertie s("Timeout").Se tValue(ftpConne ctionManager,
Dts.Variables(" FTPTimeout").Va lue)

ftpConnectionMa nager.Propertie s("ChunkSize"). SetValue(ftpCon nectionManager,
Dts.Variables(" FtpChunkSize"). Value)

ftpConnectionMa nager.Propertie s("Retries").Se tValue(ftpConne ctionManager,
Dts.Variables(" FTPRetries").Va lue)

ftp = New FtpClientConnec tion(ftpConnect ionManager.Acqu ireConnection(N othing))

'Next we connect to the ftp server

ftp.Connect()

ftp.SetWorkingD irectory(Dts.Va riables("FTPDir ectory").Value. ToString)

'And we obtain our file(s):

ftp.ReceiveFile s(sbDownloadFil es.ToString().S ubstring(0, _

sbDownloadFiles .ToString.Lengt h - 1).Split("|".To CharArray()), _

Dts.Variables(" FtpDestination" ).Value.ToStrin g, True, False)

End If

'If we did not download anything new there is nothing to process...

Dts.Variables(" ContinueProcess ing").Value = retrieveFiles

Dts.TaskResult = Dts.Results.Suc cess

Catch exError As Exception

Throw exError

Finally

If Not ftpWeb Is Nothing Then

ftpWeb = Nothing

End If

If Not ftp Is Nothing Then

ftp.Close()

End If

End Try

End Sub

-------------------------------------
Thanks,
Jason

"J.B. Moreno" wrote:
In article <F1************ *************** *******@microso ft.com>, Jason
<ja*******@onli ne.nospamwrote:
Hello, can someone please suggest to me how I can keep my ftp connection from
timing out after a large file download?

FTP downloads take place on two connections, most likely your command
connection is timing out for lack of use...you might give it a kick and
send it a command every once in a while.

--
J.B. Moreno
Aug 27 '08 #5
=?Utf-8?B?SmFzb24=?= <ja*******@onli ne.nospamwrote:
Hello JB,

I am new to programming, but below is the code I'm using. It works until
a large file (120MB) is downloaded. Once it downloads, no other files in
the directory are downloaded, and I get an error msg saying my connection
timed out.

Can you send me an example of what I should do based on my code below?
You probably can't do it with FtpWebRequest, it's not meant to be a full
blown FTP client. If it doesn't work under your circumstances (say your
connecting to an IBM Mainframe, or apparently downloading more than xMB)
then it doesn't work and you'll have to write your own FTP code, or get a
library that does it (not hard to do), and use that instead.

The program that I maintain that does FTP uses a clsFTP converted to VB in
2002 by Vick S.:
<http://www.tek-tips.com/viewthread.cfm? qid=1074156&pag e=8>.

Changing it back to C# isn't too hard (I did it while trying to add SSL
support).

--
J. Moreno
Aug 28 '08 #6
Hello Jason,

Apart from J. Moreno and Steve's solutions, I'd suggest your trying posting
this SQL Server DTS question to the microsoft.publi c.sqlserver.dts
newsgroup.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====

Aug 28 '08 #7
On Aug 27, 4:14 pm, Jason <jason2...@onli ne.nospamwrote:
Hello, can someone please suggest to me how I can keep my ftp connection from
timing out after a large file download?

I am using SSIS and I have tried multiple ways of ftp'ing the files in my
directory to my local hard drive, but the tasks keep failing after a large
file is downloaded. The error I'm getting is:

An error occurred in the requested FTP operation. Detailed error
description: Receiving file "usfile.zip ".
The operation timed out

The file is about 120MB.

I tried using the ftp task, as well as writing (reverse engineering) an ftp
script task using FtpWebRequest.C reate and both methods work as long as the
files are small.

It looks like the ftp timeout property has to be set between 1 and 300, so
even though I am explicitly assigning a timeout property of 0 in my
connection via script, it is still timing out.

Any suggestions are much appreciated. I've been struggling with this issue
for about a week now.

Thanks!

Jasonhttp://www.lonestarfin ancing.com
That may not do the trick but you may try, have you tried:

My.Computer.Net work.DownloadFi le(....) method and increase
"connectionTime out" parameter to what you want.(It represents 32-bit
integer to specify).

See this:
http://msdn.microsoft.com/en-us/library/ack30t8y.aspx

Onur Güzel
Aug 28 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2541
by: Matt | last post by:
I am having trouble with the HttpWebRequest.GetRequestStream method. I am posting data to my web server running NT4 iis4 using a loop. So every time the loop executes I want it to post data to my web page. It work the first 2 times the loop iterates, but on the third time around it gives me a timout error. The line it gives me an error on is: --Stream newStream = myRequest.GetRequestStream();--
9
2808
by: Andrew Au | last post by:
Dear all, I am trying to write a piece of software that use Object Oriented design and implement it with C, I did the following == In Object.h == typedef struct ObjectStructure* Object; Object object_create(); int object_getIntegerAttribute(Object object);
4
1261
by: mg | last post by:
I can't get WebForm1 to load load automatically after a session timeout, with the following code. How can I do so In Web.config <sessionState mode="InProc timeout="1" / In Global.asax.cs
0
968
by: Eyal Sharabi Horwitz | last post by:
im trying to use the sqlhelper.filldataset on a few tables with querys that return num of rows ranging from 16 to just shy of 6000, and it always fails to load my last (and largest table) because of a timeout expired exception. is there anyway to change the timout settings for this function? or perhaps some other way to avoid this rather annoining little error?
0
1119
by: Perecli Manole | last post by:
I have a need for logged in users to be timed out after 20 min of inactivity. This works well with the built in functionality that ASP.NET provides except for a certain situation. I have a reminder system in one of the stationary frames that polls the server every several minutes to see if a reminder is due. The polling mechanism uses a client side ActiveXObject("Microsoft.XMLHTTP") object so the whole page doesn't refresh constantly....
2
1539
by: Bernie Yaeger | last post by:
I'm getting the following error - not always, only randomly - when I run a certain routine (the routine is a simple executenonquery and it appears to complete despite the message) against sql server 2000: "timout expired. The timeout period elapsed prior to completion of the operation or the server is not responding" Anyone have any idea what causes this and how to avoid it? Thanks for any help.
6
2037
by: roguefeebo | last post by:
Hello everyone, thanks for looking. I'll get right to the point: I'm having problems trying to figure out a hierarchy of menus in C; command-line style. Say, for example the program analyzes a file of names/letters to figure out the patterns of letters within the names. The user should be able to do many things with the information such as add names, delete names, and add new letters (a letter is defined as any subset of a group of...
14
2097
by: Stephany Young | last post by:
Even though I had my roots and highlights redone just a few days ago, I don't understand why I appear to be having an ongoing blond moment. Is it just me or do others among you not 'get' how to make C# and VB.Net applications play nicely with the the UAC on Vista. I have read and reread everything I can find on UAC, 'strong-naming' of assemblies, 'authenticode signing' of assemblies and, even though I'm not your average thicko by any...
5
3059
by: prognoob | last post by:
I have searched online, and what I mostly come across is what these security issues are... for example, Worms, Backdoor Trojan Horses, Hijacking and Impersonation, Denial of Service etc. but I dont recall coming across something that deals with HOW I would avoid these issues while writing my messenger. From what I have understood so far, the security really does depend a lot on the user, because he ultimately decides who he should receive...
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.