.... but dont forget to keep your cfc method threadsafe, you have to var any variables you use inside the method.
You have an example of passing in the form scope to a CFC in that tutorial i wrote about using objects. And you can loop over the list contained in the variable #form.fieldnames# There's a tutorial on my site that covers processing of multiple files uploaded - there might be something you can get from that - its at http://afpwebworks.com/Index.cfm?pid=111335 Cheers Mike Kear Windsor, NSW, Australia Adobe Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month On Tue, Dec 30, 2008 at 2:16 PM, Robert Bailey <[email protected]> wrote: > Just pass the form as a struct variable, which is what the form is to > begin with, and you can loop through it using the same code (with little > changes) that you already have. > > Thanks! > Robert Bailey > 210.748.2363 > > > > Rick Faircloth wrote: >> I have this code that I've kept in my .cfm file >> to process images. The form has an image field that >> can be cloned via jQuery, so I don't know before a form >> is submitted how many fildfields it will have. Therefore, >> I have to loop through the fieldnames and process the fields >> named a certain way to specify images to be processed. >> >> I kept this code in the form's .cfm file, because I wasn't >> sure what to "loop"...in this code I loop through the form >> with collection="#form#". >> >> Would I loop through collection="#arguments#" once the form >> variables are passed to the component via argumentCollection? >> >> Or am I better off keeping this code in the .cfm? >> >> Thanks, >> >> Rick >> >> Here's the code: >> >> <cfloop collection="#form#" item="fieldname"> >> >> <cfset form.rental_photo_original=""> >> <cfset form.rental_photo_w200=""> >> <cfset form.rental_photo_w500=""> >> >> <cfif left("#fieldname#", 5) eq "image"> >> >> <cffile action="upload" filefield="#fieldname#" >> destination="e:\inetpub\webroot\fortstewart\user_images" >> accept="image/jpg, image/pjpg, image/jpeg, image/pjpeg" >> nameconflict="makeunique"> >> >> >> etc... >> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317262 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

