cfsftp - dir as query - minor release

As promised in my last entry, a new minor release of cfsftp (1.3.2) is now available to download that returns a query instead of an array when you call the dir method.

Please let me know if there are any issues with other server configurations. My test environment is connecting from windows to a Red Hat Linux server and it seems to work OK, but some users have had issues with other configurations.

Enjoy.

Comments
Markus's Gravatar I wonder why you do an expandPath() on the workingdir-Parameter? It's quite difficult to access some local directory outside of the webroot. I'd find it rather less confusing if workingdir was really an absolute path in relation to the local filesystem - one could always use getCurrentTemplatePath() or similar functions to pass the correct value to this parameter if one would actually wish to use some form of relative addressing.

Apart from this minor annoyance - cfsftp is really some extremely useful piece of code :)
# Posted By Markus | 1/23/07 4:03 PM
Markus's Gravatar Regarding my above post, I'd really be very happy if I had some option to influence the CFC's behaviour about the expandPath of the working_dir parameter, maybe like so:

diff sftp.cfc.original sftp.cfc.patched
4a5
> <cfargument name="abspath" required="false" default=FALSE>
8d8
< variables.working_dir = expandPath(arguments.workingdir);
16a17,20
> if (arguments.abspath)
> { variables.working_dir = arguments.workingdir; }
> else
> { variables.working_dir = expandPath(arguments.workingdir); }

I have introduced a new optional parameter abspath, which defaults to TRUE, but when set to TRUE, would use the working_dir parameter without further processing, thus allowing for absolute path declarations relative to the local filesystem root:

<cfset mysftp = createobject("component","CFLib.sftp").init(workingdir="/var/www/myapp/mysubfolder/", abspath=TRUE)>

Kind regards

Markus
# Posted By Markus | 1/23/07 4:27 PM
David Kuenzler's Gravatar I get a "CFSFTP.dir;Failure" exception in dir() when the remote directory has more than 184 entries.
After uncommenting the try...catch in SFTP.cfc dir() I get this:

java.io.IOException: inputstream is closed
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2125)
at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2149)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1194) ...

It's probably a Proxy/Firewall/SFTP Server issue because with a local SFTP Test Server it works fine.
But the server that does not work with CFSFTP works with other SFTP clients like Filezilla,...

Has anyone else run into this problem?

Thanks, David
# Posted By David Kuenzler | 3/6/07 3:27 PM
Matthew Abbott's Gravatar Has anyone tried to do FTPS over SSL using the new CF8 and .NET? The cfftp only does SFTP on cf8 and i need a "free" solution to do FTPS over SSL with cf. Im looking at the .NET classes and I can convert mostly everything to cf8 except a few lines...

Some of the .NET info shows how I can trust any certificate with the ServicePointManager. and it uses a delegate() method. I cannot for the life of me figure out how to convert this into CF code.

http://blogs.msdn.com/adarshk/archive/2005/04/22/4...

Im hesitant to list another blog's url, but That shows how to do it in .NET. I just need to convert it over to CF8.

Thanks all.

Matthew
# Posted By Matthew Abbott | 10/22/07 1:55 AM
Rick's Gravatar We've been using cfsftp in an application for about 8 months now, and it's been a lifesaver. A head's up: We just upgraded to CF8 (from MX6.1) and it appears to break cfsftp. Here's the error that was generated:

Object Instantiation Exception.
Class not found: MyProgressMonitor
The error occurred in ....... \sftp.cfc: line 7
5 : <cfscript>
6 :     variables.jsch = createobject('java',"com.jcraft.jsch.JSch");
7 :     variables.mymonitor = createobject('java',"MyProgressMonitor");
8 :     variables.working_dir = expandPath(arguments.workingdir);
9 :     variables.errormess = arrayNew(1);

Fortunately, CF8 has sftp functionality built-in. But thanks for making cfsftp available -- like I said, it's really been a lifesaver for us.
# Posted By Rick | 4/10/08 7:01 PM
Oyun's Gravatar harika bir olay üstüne diyecek bir_ey bulam1yorum umar1m daha ba_ar1l1 i_lere imza atars1n1z sizleri tebrik ediyor ba_ar1lar1n1z devam1 diliyorum. Kolay gelsin.


visit : http://www.Aylak.com
# Posted By Oyun | 5/16/08 12:48 AM
tavla indir's Gravatar tavla oyunu
# Posted By tavla indir | 6/22/08 8:23 PM
siirt's Gravatar siirtliler
# Posted By siirt | 6/24/08 8:46 PM
tom w's Gravatar It seems I can use the cfc once. Then it will just hang on any further attempts to use it. If I restart the CF Service it will work again, once. I'm using Windows 2003 Server. Any ideas would be appreciated.
# Posted By tom w | 7/30/08 3:08 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.003. Contact Blog Owner