From: jkeenagh on
Hi all,

I'm having a lot of trouble using cfftp on CF8. Identical code works fine on
CF7.

When I invoke the following function from a Model-Glue event : I get different
behaviour in CF7 and CF8. In CF8 after the first request when I dump the
connection I get a struct with the connection details and everything works
fine. However, on the 2nd request, the connection is empty string meaning the
open command didn't work. After much looking I found an object in the Variables
scope called MFTPINTERFACE which is of type coldfusion.tagext.net.FtpHandler,
containing all the ftp type functions (changeDir(), getCurrentDir(),
openConnection(), closeConnection() etc.). I've found that if I delete this
object from Variables the connection opens fine as on the first request.
Presumably it is some sort of connection cacheing which misfires in CF8. Just
to clarify, this object isn't there in CF7 when executing the same requests.

Has anyone any idea what this object is and how I should go about resolving
this?

Thanks,
Julian

<cffunction name="myfunc" access="public" returnType="void" output="false">
<cfargument name="event" type="any">

<cfset var theConnection = "" />
<cfset var ftp = "" />

<!--- Dump the Variable scope --->
<cfdump var="#Variables#">

<!---- open connection ------>
<cfftp action="open" server="servername" username="username"
password="password" timeout="10" connection="theConnection" result="ftp" />

<!--- Dump connection --->
<cfdump var="#theConnection#" />

<!--- close connection ---->
<cfftp action="close" connection="theConnection" result="ftp" />

</cffunction>