Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfftp skip files

Status
Not open for further replies.

redoakhg

Programmer
Nov 30, 2006
38
US
Hi,

Looking for a solution to skip moving file names prefaced with donotimport. Basically, I want to move all files with the excetion of those that start with donotimport. So my files in the directory may look like:
newmembers5_22_2011.txt
newmembers5_23_2001.txt
newmembers5_23_2011.xml
readyforcom.csv
donotimport_badpeople.csv
donotimport-sadpeople.txt
donotimportallisgood.xml

Ideas?

Thanks!
 
Something like this?
Code:
<cfdirectory action = "list" directory = "MyDir\" name = "MyFileList"> 
<cfftp connection="MyTargetServer" server="MyTargetServer.com" username="MyLiginID" password="MyPassword" action="Open" stoponerror="Yes">
<cfoutput query="MyFileList">
  <cfif MyFileList.NAME Does Not Contain 'donotimport'>
    <cfftp connection="MyTargetServer" action="PutFile" stoponerror="No" localfile="MyDir\#MyFileList.NAME#" remotefile="#MyFileList.NAME#">
  </cfif>
</cfoutput>		
<cfftp action="close" connection="MyTargetServer">

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top