Retrieving & Saving XML attachments to MySQL Database
I've taken Ben Nadel's XML to MySQL Database Method Three and combined it with CFPOP to retrieve and save (JULIE digging/locating XML attachments sent by email) to a MySQL database table.
- The code works great when run, and the "static" XML data file is saved as a new record in my table. (see pdf link below)
- But how can I alter the code to work with dynamic XML file name(s)
- Currently I have hard-coded the <cffile action="read" file="C:\locates\xmlLocateAttachments\JULIEA_JULIEV_20120213133643312.xml" because I'm not sure how to tell it to just look at the folder, rather than specific files!
- I need to make this a dynamic process, where the CFPOP code/section/page runs every 30 min, and if a new email has arrived, then save the XML attachment(s) to the folder, and finally have Ben's code run that copies each XML attachment record to the database table?
ps: In each email from JULIE, there is always just one attachment, always in XML, with identical fields. I plan to have CFPOP delete the email once it has been processed..
Thanks, jlig
Here is my code: http://cerberus.clearwave.com/jerry/Untitled-2.pdf
Here is Ben's link: http://www.bennadel.com/blog/1636-How-To-Move-XML-Data-Into-A-Database-Using-ColdFusion.htm?&_=0.31745311200482734#comments_38922
