• Home
  • About
  • Archives
  • Links
  • Sitemap
Subscribe: Posts | Comments | E-mail
  • Personal stuffMostly family-related
  • ReviewsProduct/Book/Whatever Reviews
  • Side projectsStuff that I'm working on sometimes
  • WorkingRelates to Industry Interactive mostly

Flyingtroll.com

Posted on July 7, 2009 - by J Lane

CFFTP not returning a directory listing

Featured Posts Technology abuse

In my Googling, I couldn’t find anything about it, so I thought I’d post something here.  It might seem painfully obvious to most ColdFusion developers, but my brain has been dealing with a head cold, and I just couldn’t figure out what I was doing wrong.

I’m not sure if it’s true of all servers/situations, but I was running into a problem with CFFTP recently.  I could connect to an FTP server fine, and get a directory listing of the root folder, but subfolders weren’t returning anything.  There wasn’t an error returned, it just returned nothing.

Turns out what I was doing wrong was that you actually need to change into the working directory before listing it’s contents.  In retrospect, yeah, it makes sense, but it was something that confused me for an hour or so.

<cfftp connection="myConnection" action="changeDir" directory="/some/sub/folder/">
<cfftp connection="myConnection" action="listDir" directory="/some/sub/folder/">

Seems silly to me that it works this way, especially because you have to specify complete paths in all CFFTP operations.  It would be one thing if I just had to specify the complete path in the changeDir operation, and then listDir would just assume I mean the current working directory (the directory attribute would be optional), but it doesn’t work like that.  Same deal for getFile and putFile operations… have to specify the complete path.

Not the end of the world, just mildly annoying.

This entry was posted on Tuesday, July 7th, 2009 at 11:48 am and is filed under Featured Posts, Technology abuse. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

1 Comment

We'd love to hear yours!




  • Hey there!

    Flyingtroll.com is the personal web site of Jonathan C Lane, a Mayne Island, BC-based web developer, author and all-around great guy.

    Why not SUBSCRIBE and make the whole reading thing effortless?

  • Flickr Photos

  • RSS Industry Interactive

    • The Erickson Group April 28, 2010
    • Arbutus Cottage Spa – Flyer April 28, 2010
    • RE/MAX Mayne Pender – Real Estate April 28, 2010
  • RSS DiscoverGulfIslands.com

    • Winter storms November 20, 2009 J Lane
    • Small communities November 4, 2009 J Lane
    • Halloween on Mayne November 3, 2009 J Lane
© 2008 Flyingtroll.com - Jonathan C Lane is once again bringing sexy back