3

I am running CF 11. I have a file on a SFTP server that I want to get. This is a zip file about 60MB in size.

I can get the SFTP connection. However, when I use action="getfile" to get the file to my local. The error that I am getting is, "getFile operation exceeded TIMEOUT". The local file size always stops at around 15MB. I have tried specifying the timeout to 999999 in the cfftp tag, setting passive to false in the cfftp tag, and adding the cfsetting tag to set requesttimeout to 999999. The behavior stays the same.

I have looked everywhere in CF admin and I don't seem to find where this 15MB is specified. Would anybody be able to help me solve this problem please?

Monte Chan
  • 1,193
  • 4
  • 20
  • 42
  • If I recall correctly the `cfsetting` tag to set the `requesttimeout` was the trick to make this work. Have you tried a more reasonable setting than `999999`? Say something like 1 hour (`3600`). And just to rule it out, have you tried manually FTP'ing the file to see if that works (not using ColdFusion)? If that works to your workstation, then try it again from the ColdFusion server (manually not using ColdFusion). That will help narrow this down to a ColdFusion problem or not. – Miguel-F Jan 05 '17 at 18:09
  • I have done the FTP'ing using my SFTP client many times and I can get the files transferred to my local drive. Due to a change of staff, the person that was responsible for this operation has left. I took over this process. Instead of doing things manually (after grabbing the file, there are things I need to do to the file contents, too), I am creating a CF scheduled task to handle the process. Tried 3600 and no it does not work. – Monte Chan Jan 05 '17 at 18:17
  • 1
    Can you add your ColdFusion code in question to the original post? Obviously remove any user credentials or other security information before posting. Specifically I would like to see your connection open and getfile statements. If you are using a _cached_ connection then the timeout setting needs to be set on the open of the connection, not on the get. Or perhaps on both. – Miguel-F Jan 05 '17 at 18:24
  • 1
    Putting timeout on the open action is the problem. It is working now! @MiguelF Thank you very much! I had it only on the get. – Monte Chan Jan 05 '17 at 18:53
  • Cool glad that helped. I added an appropriate answer so that others finding this post can see it more clearly. – Miguel-F Jan 05 '17 at 19:43

1 Answers1

5

There are a couple of timers in play here; the FTP timer and the ColdFusion page request timer since you are calling a CFML page to do this.

To increase the ColdFusion timer you need to use the cfsetting tag on the page using the cfftp tag. Like,

<cfsetting requestTimeout="3600" />

To increase the FTP timer you need to use the timeout setting of the cfftp tag itself. What's tricky here is that if you are using a cached FTP connection (using the connection attribute) you need to add the timeout attribute to the open call of your CFFTP tag.

You will need to use both of these settings to increase the overall timeout for these requests.

Miguel-F
  • 13,450
  • 6
  • 38
  • 63