something like this?

<!--- assuming we just queried qFonts to get font filenames under a field
named Font_File--->
 <cfftp action="OPEN"
  username="FTPUserName"
  password="FTPPassword"
  server="FTPServer"
  passive="Yes"
  stoponerror="No"
  connection="FontFTP">
 <cfset arrErrors = ArrayNew(2)>
 <cfset pathToFontLocal = 'c:\Fonts'>
 <cfset pathToFontRemote = '/fonts'>
 <cfloop query="qFonts">
  <cftry>
   <cfftp action="PUTFILE"
    localfile="#pathToFont#\#qFonts.Font_File#"
    remotefile="#pathToFontRemote#/#qFonts.Font_File#"
    failifexists="Yes"
    stoponerror="Yes">
  <cfcatch type="Any">
   <cfset ErrorNumber = IncrementValue(ArrayLen(arrErrors))>
   <cfset arrErrors[ErrorNumber][1] = qFonts.Font_ID>
   <cfset arrErrors[ErrorNumber][2] = qFonts.Font_File>
   <cfset arrErrors[ErrorNumber][3] = cfcatch.message>
  </cfcatch>
  </cftry>
 </cfloop>
 <cfftp action="CLOSE"
  connection="FontFTP"
  stoponerror="Yes">
 <cfloop from="1" to="#ArrayLen(arrErrors)#" index="i">
  <cfoutput>
   Error attempting to FTP #arrErrors[i][2]# : #arrErrors[i][3]#<br>
  </cfoutput>
 </cfloop>

*shrug*

Nate Nielsen
[EMAIL PROTECTED]
817.726.8644

----- Original Message -----
From: "phumes1" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 19, 2002 9:22 AM
Subject: Re: <CFFTP files to location on server or client if possible?


>
> Hi,
>
> How can I FTP the files selected from my database to a destination on the
> server?
>
> I select the files from my index.cfm file which the results from my
> database get passed to "create-list.cfm" which creates a list
> of the fontnames selected and corresponding .pfb files. I want to be able
> to FTP all .pfb files listed to a directory on the server but
> don't know how to go about it.
>
> Any suggestions or code? :-)
>
>
> Below is my code.
>
> index.cfm
> -------------
>
> <cfform action="create-list.cfm" name="checkboxform" method="POST">
> <cfquery name="GetFontFamily" datasource="fontstyles">
> SELECT      sti, ID
> FROM        fontsti
> ORDER BY sti
> </cfquery>
>
> <td class="dirlinks">
> <cfoutput query="GetFontFamily">
> <cfif #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'BorderPi-15159' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Bundesbahn-Pi' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCH-Australia-Logos' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCH-Folio-Views' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCH-Logos' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCH-Logos-PH' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCHFM-Lawlines' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCHFM-Logos' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Carta' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Century' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Custom' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Environmental Logo' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Euro' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'European-Pi' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Garamond' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Helvetica' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Linotype-Decoration-Pi'
OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Linotype Holiday-Pi' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Lucida-Math-Extension'
OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Mathematical-Pi' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Old-Style-Seven' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Symbol' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Times' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Times-Serials' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Wood-Ornaments' OR
>   #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Zapf-Chancery-Dingbats'>
> <input type="Checkbox" name="select" value="#GetFontFamily.ID#"
> checked="Yes" required="Yes" onclick="this.checked=true;"><img
> src="../../images/blank.gif" width="3" height="14" alt="" border="0"><font
> color="red">&nbsp;#LCase(ListGetAt(GetFontFamily.sti,1,'.'))#</font><br>
> <input type="hidden" name="ID" value="#GetFontFamily.ID#">
> <cfelse>
> <cfinput type="Checkbox" name="select"
>
value="#GetFontFamily.ID#">&nbsp;#LCase(ListGetAt(GetFontFamily.sti,1,'.'))#
<br>
> </cfif>
> </cfoutput>
> </td>
> </tr>
> <tr>
> <td class="navlinks">
> <input class="navlinks" type="submit" name="Action" value=" Generate ">
> &nbsp;<input class="navlinks" type="submit" name="Action" value="Close"
> OnClick="window.close()">
> <br>
>
>
> create-list.cfm
> -------------------
>
> <cfquery name="GetMyFonts" datasource="fontstyles">
> SELECT fontsti.sti, fontsti.ID, fontspecs.pfb
> FROM fontsti, fontspecs
> WHERE fontsti.ID = fontspecs.fontsti_ID
> AND fontsti.ID IN (#form.select#)
> ORDER BY sti
> </cfquery>
>
>
> <cfoutput query="GetMyFonts" group="ID">
> #LCase(ListGetAt(GetMyFonts.sti,1,'.'))#<br>
> <cfoutput>[#GetMyFonts.pfb#]</cfoutput>
> <hr>
> </cfoutput>
>
>
>
> -------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info: www.mailshield.com
>
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
>


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to