Highlighted

CFFTP GETFILE and other questions

Participant ,
Jul 18, 2019

Copy link to clipboard

Copied

Hello community, I am having some issues when trying to get some files from an FTP site.

This is the situation:

I need to be able to connect to the FTP, list the files (all XML), read them and then save their contents into a DB table.

So far I can connect, I can read the files. This part is ok when I test in my own FTP/Coldfusion server.

However, the real scenario is different: files are in a different server server. So From my server I CFFTP to this server, I list the files and it works great.

But in order to read the XML files I need to get them first to my local machine and from it to upload it to my server where I have ColdFusion. Once there I can do whatever I want.

But I can't get the files.

So this is what I do:

1. I open the connection.

1.png

2. I list its contents and while I loop, I do the getFile:

2.png

So I have no error and the files are listed on screen, but no file is saved on my Desktop:

3.png

Any idea what could I be doing wrong?

Thank you!

Where is the "/HD1 - Main/Users" folder, on your local machine or the machine running ColdFusion? The LOCALFILE must specify a location local to the machine running your ColdFusion server.

J

Views

366

Likes

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

CFFTP GETFILE and other questions

Participant ,
Jul 18, 2019

Copy link to clipboard

Copied

Hello community, I am having some issues when trying to get some files from an FTP site.

This is the situation:

I need to be able to connect to the FTP, list the files (all XML), read them and then save their contents into a DB table.

So far I can connect, I can read the files. This part is ok when I test in my own FTP/Coldfusion server.

However, the real scenario is different: files are in a different server server. So From my server I CFFTP to this server, I list the files and it works great.

But in order to read the XML files I need to get them first to my local machine and from it to upload it to my server where I have ColdFusion. Once there I can do whatever I want.

But I can't get the files.

So this is what I do:

1. I open the connection.

1.png

2. I list its contents and while I loop, I do the getFile:

2.png

So I have no error and the files are listed on screen, but no file is saved on my Desktop:

3.png

Any idea what could I be doing wrong?

Thank you!

Where is the "/HD1 - Main/Users" folder, on your local machine or the machine running ColdFusion? The LOCALFILE must specify a location local to the machine running your ColdFusion server.

J

Views

367

Likes

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
Jul 18, 2019 0
LEGEND ,
Jul 18, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/Dani+Szwarc  wrote

read them and then save their contents into a DB table.

Why not just store the binary in the database?

As far as why the files aren't downloading to your local server, I'm not sure.  I've never tried placing a getfile inside a loop.  Have you tried breaking out of the loop on the first iteration just to see if one file will download?  If that doesn't get you one file, then the issue is something else.

Is anything appearing in any of the CFAdmin logs?  Or in the webserver logs?  Are you using IIS, Apache, or the built-in webserver?

V/r,

^ _ ^

Likes

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
Reply
Loading...
Jul 18, 2019 0
Participant ,
Jul 18, 2019

Copy link to clipboard

Copied

Where is the "/HD1 - Main/Users" folder, on your local machine or the machine running ColdFusion? The LOCALFILE must specify a location local to the machine running your ColdFusion server.

J

Likes

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
Reply
Loading...
Jul 18, 2019 1
Participant ,
Jul 18, 2019

Copy link to clipboard

Copied

John, that did the trick! Thank you very much!

All the examples I see online for the "GetFile" talk about local directory. When I read "local" I understood was actually my computer.

I really appreciate your help!

Hey WolfShade, thank you for your input as well!

Likes

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
Reply
Loading...
Jul 18, 2019 0