I am trying to use CFFTP to log onto buy.com's marketplace and download an account's orders. Buy.com allows you to FTP into your account folder and download your orders as TXT files for your own reference. I know the credentials I have are working fine because I can log in successfully using any FTP desktop program, so that's not an issue.
What am I having trouble with is actually listing the contents of the FTP's root folder. I should be seeing folders like these:
- Cancellations
- Fulfillment
- Inventory
- NewSku
- Orders
- Payments
- Refunds
The folder "Orders" contains the TXT files with the customer's orders, and is the folder I eventually want to get a listing of. However, I get an empty listing (empty query when I dump the "dirlist" variable below) even though the CFFTP call looks like it connects and disconnects fine. I tried changing the directories to get a listing of, "/" or "/Orders/", even "/Orders", but all come back empty.
Here is my code (I edited the username and password for obvious reasons). Any ideas are welcome.
<cfparam name="dirlist" type="query" default="#queryNew('')#" />
<cfftp connection="myConnection"
username="***************"
password="*********"
server="trade.marketplace.buy.com"
action="open"
stopOnError="yes"
/>
<p>Successful open? <cfoutput>#cfftp.succeeded#</cfoutput></p>
<cfftp connection="myConnection"
action="listdir"
stopOnError="yes"
name="dirlist"
directory="/Orders"
/>
<cfdump var="#dirlist#" />
<cfftp connection="myConnection"
action="close"
stopOnError="yes"
/>
<p>Successful close? <cfoutput>#cfftp.succeeded#</cfoutput></p>
And these are the results as seen in the browser ("query" is basically the empty var dump of the directory listing):
Successful open? YES
query
Successful close? YES