• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFFTP Issues

LEGEND ,
Aug 29, 2007 Aug 29, 2007

Copy link to clipboard

Copied

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?
--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126


TOPICS
Advanced techniques

Views

577

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

what's the error?

--

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

WebDev wrote:
> and the remote file is to the root of the ftp.

the root of ftp does not necessarily equal the web root, you know...

--

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

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?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

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">





Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

what happened when you tried both code pieces?

--

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

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


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2007 Aug 30, 2007

Copy link to clipboard

Copied

LATEST
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...

--

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation