Er, I just pass the name of the form field since the FORM scope is already available inside the CFC?


fileObj.doUpload('form.fieldname');

Dave Carabetta wrote:

I was having trouble getting a file upload to work when uploading via
a CFC method. I did a search of the archives and noticed that the
solution was to pass the the form scope into the CFC because of a page
context issue (no, not the 6.0 page context bug) and create a local
variable named form to hold the passed-in scope, i.e.:

<cfset var form = arguments.form />

So I did that and I have file uploading via a CFC method working.
However, my problem is that it feels awfully "dirty" and I'm really
not comfortable passing in an entire scope just to get at one file
field. I could theoretically move the upload out of the CFC and into
either a custom tag or just keep it straight in the calling code, but
those two, to me, break encapsulation. Using a custom tag, I have an
object that know how to do everything else associated with the upload
file *except* how to upload it, which I don't like. And with the
in-line call, that violates my goal of keeping all business logic out
of the presentation layer.

What have you guys been doing for file uploads via CFCs? Is the form
scope solution the only way?

Regards,
Dave.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to