CFFTP - CFLOOP Prob.
I can't see what I am doing wrong. I have the index page where the user types in the name of the directory, chooses the file to upload finally selects which servers to send it to via checkbox. Since there is a possibility of multiple servers, I use CFLOOP to loop throught the delimitered list. This works fine and all. But if I select any server minus the first one, I get an error with CFFTP. I know that the CFFTP code works and that the list is understandable. Any clues here? Thanks in advance. Richard Ramos Network Administrator Softitler Net, Inc. www.softitler.com [EMAIL PROTECTED] index3.cfm html body cfquery name="site" datasource="upload" SELECT * FROM Servers /cfquery cfloop index="servername" list="#session.servername#" cfoutput cfif #site.name# IS "#servername#" cfftp connection="ftp" action="open" username="#site.username#" password="#site.password#" server="#site.address#" /cfif cfftp connection="ftp" action="changedir" directory="SomeDir" cfftp connection="ftp" action="createdir" directory="#session.directory#" failifexists="Yes" cfftp connection="ftp" action="changedir" directory="#session.directory#" cfftp connection="ftp" action="putfile" localfile="C:\Inetpub\ftp\SomeDir\#session.directory#\#session.filename#" remotefile="#session.filename#" stoponerror="yes" transfermode="binary" cfftp connection="ftp" action="close" cfoutput #servername# uploadedbr /cfoutput /cfloop /body /html -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: CFFTP - CFLOOP Prob.
Richard: When using CFFTP the connection attribute is used so you don't have to retype a lot of the other attributes over and over again. It essentially saves the connection data for you which is quite useful. However if you try to connect to another server and specify the same connection you'll run into problems as it will try to use the old connection data. I think an easy solution to your problem is to make your connection attribute use a dynamic name. You could do this by tacking a random number on to the connection name or by using the name/ip of the server itself as the connection name. Let me know if this helps. Andrew Hewitt Web Application Developer webworld studios, inc. www.wwstudios.com -Original Message- From: Richard Ramos [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 16, 2000 12:16 PM To: CF-Talk Subject: CFFTP - CFLOOP Prob. I can't see what I am doing wrong. I have the index page where the user types in the name of the directory, chooses the file to upload finally selects which servers to send it to via checkbox. Since there is a possibility of multiple servers, I use CFLOOP to loop throught the delimitered list. This works fine and all. But if I select any server minus the first one, I get an error with CFFTP. I know that the CFFTP code works and that the list is understandable. Any clues here? Thanks in advance. Richard Ramos Network Administrator Softitler Net, Inc. www.softitler.com [EMAIL PROTECTED] index3.cfm html body cfquery name="site" datasource="upload" SELECT * FROM Servers /cfquery cfloop index="servername" list="#session.servername#" cfoutput cfif #site.name# IS "#servername#" cfftp connection="ftp" action="open" username="#site.username#" password="#site.password#" server="#site.address#" /cfif cfftp connection="ftp" action="changedir" directory="SomeDir" cfftp connection="ftp" action="createdir" directory="#session.directory#" failifexists="Yes" cfftp connection="ftp" action="changedir" directory="#session.directory#" cfftp connection="ftp" action="putfile" localfile="C:\Inetpub\ftp\SomeDir\#session.directory#\#session.filename#" remotefile="#session.filename#" stoponerror="yes" transfermode="binary" cfftp connection="ftp" action="close" cfoutput #servername# uploadedbr /cfoutput /cfloop /body /html -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: CFFTP - CFLOOP Prob.
Nevermind, fixed it. I needed a stoponerror="yes" in the CFFTP open statement. Richard Ramos Softitler Net, Inc. www.softitler.com [EMAIL PROTECTED] - Original Message - From: "Richard Ramos" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Thursday, November 16, 2000 9:16 AM Subject: CFFTP - CFLOOP Prob. I can't see what I am doing wrong. I have the index page where the user types in the name of the directory, chooses the file to upload finally selects which servers to send it to via checkbox. Since there is a possibility of multiple servers, I use CFLOOP to loop throught the delimitered list. This works fine and all. But if I select any server minus the first one, I get an error with CFFTP. I know that the CFFTP code works and that the list is understandable. Any clues here? Thanks in advance. Richard Ramos Network Administrator Softitler Net, Inc. www.softitler.com [EMAIL PROTECTED] index3.cfm -- -- html body cfquery name="site" datasource="upload" SELECT * FROM Servers /cfquery cfloop index="servername" list="#session.servername#" cfoutput cfif #site.name# IS "#servername#" cfftp connection="ftp" action="open" username="#site.username#" password="#site.password#" server="#site.address#" /cfif cfftp connection="ftp" action="changedir" directory="SomeDir" cfftp connection="ftp" action="createdir" directory="#session.directory#" failifexists="Yes" cfftp connection="ftp" action="changedir" directory="#session.directory#" cfftp connection="ftp" action="putfile" localfile="C:\Inetpub\ftp\SomeDir\#session.directory#\#session.filename#" remotefile="#session.filename#" stoponerror="yes" transfermode="binary" cfftp connection="ftp" action="close" cfoutput #servername# uploadedbr /cfoutput /cfloop /body /html -- -- -- -- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] ~~ Structure your ColdFusion code with Fusebox. Get the official book at https://secure.houseoffusion.com Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists