I am trying to get a file from an ftp server and bring it down to my hosting
web site. What am I doing wrong? I keep getting an error.
<cfftp connection="RealComp" server="ftp.realcomponline.com"
username="******" password="******" action="Open" stoponerror="Yes"
port="21">
<cfftp action="getfile" connection="RealComp" remotefile="/#newFile#"
localfile="E:\bpoprosonline.com\assets\property\#newFile#" passive="yes">
All the server, username, and password information is correct and the remote
file is to the root of the ftp. Anything else look odd?

Signature
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126
Azadi - 30 Aug 2007 08:03 GMT
what's the error?

Signature
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
WebDev - 30 Aug 2007 16:34 GMT
First I got a security error which I fixed with passive="yes", but then I
get an error telling me that the connection was closed.
When I log into the ftp using a normal client, I go right into the directory
with the files I need using ftp.realcomponline.com, so I assume I would do
the same in my set up as remoteFile="/filename", but I dont seem to grab the
file. I keep getting an empty file with the right name in the right local
directory so it seems to be the correct localfile.
Is the localFile one the FTP server and the remotefile where I want to put
it?
Azadi - 30 Aug 2007 08:37 GMT
> and the remote file is to the root of the ftp.
the root of ftp does not necessarily equal the web root, you know...

Signature
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
WebDev - 30 Aug 2007 16:40 GMT
I guess what I need to know is how to I connect to ftp.realcomponline.com
using my username and password. Create a connection (action=open) called
something like 'RealComp'.
Then I need to grab a file from the main directory called 'idxcn0829072.txt'
and then move it to my web site's directory at
E:\webs\bpoprosonline.com\assets\property
<cfftp connection="RealComp" server="ftp.realcomponline.com"
username="myuser" password="mypass" action="Open" stoponerror="Yes"
port="21">
<cfftp action="getfile" connection="RealComp" localfile="idxcn0829072.txt"
remotefile="E:\bpoprosonline.com\assets\property\idxcn082907.txt"
passive="yes">
or
<cfftp action="getfile" connection="RealComp" remotefile="idxcn0829072.txt"
localfile="E:\webs\bpoprosonline.com\assets\property\idxcn082907.txt"
passive="yes">
Azadi - 30 Aug 2007 16:49 GMT
what happened when you tried both code pieces?

Signature
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
WebDev - 30 Aug 2007 18:17 GMT
Nothing worked. I stopped getting the errors with the remoteFile being set
to the FTP server, but I am not getting any files. AND no errors so I have
no idea whats happening
Azadi - 31 Aug 2007 03:07 GMT
try this code to test where the problem is. this code is straight from
DW CF help:
===========================================================
<p>Open a connection
<cfftp connection = "myConnection"
username = "enter username here"
password = "enter password here"
server = "ftp server address here"
action = "open"
stopOnError = "Yes">
<p>Did Open Connection succeed? <cfoutput>#cfftp.succeeded#</cfoutput>
<cfftp connection = "myConnection"
action = "LISTDIR"
stopOnError = "Yes"
name = "ListDirs"
directory = "/">
<p>FTP Directory Listing:<br>
<cftable query = "ListDirs" HTMLTable = "Yes" colHeaders = "Yes">
<cfcol header = "<b>Name</b>" text = "#name#">
<cfcol header = "<b>Path</b>" text = "#path#">
<cfcol header = "<b>URL</b>" text = "#url#">
<cfcol header = "<b>Length</b>" text = "#length#">
<cfcol header = "<b>LastModified</b>"
text = "#DateFormat(lastmodified)#">
<cfcol header = "<b>IsDirectory</b>" text = "#isdirectory#">
</cftable>
<p>Close the connection:
<cfftp connection = "myConnection"
action = "close"
stopOnError = "Yes">
<p>Did it succeed? <cfoutput>#cfftp.succeeded#</cfoutput>
=========================================================
look at the output of ftp dir listing and check if you have correct path
to remote file...

Signature
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com