Skip to main content
Participant
March 20, 2014
Question

Access denied on folder using CFFTP getfile

  • March 20, 2014
  • 2 replies
  • 1067 views

I'm trying to use CFFTP to retrieve files from a remote FTP site to download to my local directory. I would see the file in the local directory but with 0 kb. Wondering what was going on, I tried accessing just the directory and got an 'Access is Denied' error.

The funny thing is that it was working fine a few weeks ago until we made some server changes. We had some FTP sites set up but closed them. Could closing them have anything to do with it? I'm definitely not an expert when it comes to this stuff.

We're using CF9 and IIS7 btw.

Can someone explain what's causing this and how do I go about fixing it? Any help would be appreicated.

<cfftp

    action="getFile"

    connection="objConnection"

    remotefile="s692605.FRTB0001_RES.DAT238710"

    localfile="E:\Inetpub\test\s692605.FRTB0001_RES.DAT238710"

    stoponerror="yes"

    failIfExists="false" passive="yes" timeout="600" transfermode="auto"  />

This topic has been closed for replies.

2 replies

Participant
June 30, 2014

Sadly, I may be too late to help you, but for others hopefully this helps. I kept getting the same problem and it turns out it was because of the firewall on my dev computer that was doing it. I turned it off and the file actually sent instead of just showing 0KB.

BKBK
Community Expert
Community Expert
March 26, 2014

It is important to open the connection, use / to access the root of the FTP server and to close the connection. Something along these lines:

<cfftp action = "open"

    username = "me_myself_and_I"

    password = "a1b2c3"

    connection = "objConnection" 

    server = "ftp.myDomain.com"

    port = "21"

    passive = "yes"

    stopOnError = "Yes">

    <cfftp     action="getFile"

            connection = "objConnection"

            remoteFile = "/s692605.FRTB0001_RES.DAT238710"

            localFile = "E:\Inetpub\test\s692605.FRTB0001_RES.DAT238710">

<cfftp action = "close"

    connection = "objConnection"

    stopOnError = "Yes">