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.
Apart from this minor annoyance - cfsftp is really some extremely useful piece of code :)
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
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
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
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.
visit : http://www.Aylak.com