Peter J. Farrell wrote:
Maybe my answer is too simple here? After I wrote my reply, I thought maybe I'm missing something here... Am I?Dave Carabetta wrote:
Why don't you just pass in the the form field that has the file? form.This_File to arguments of the CFC?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]
.pjf
----------------------------------------------------------
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]
I know you don't want to pass in the the entire form scope. I guess I was thinking that you all you need to do is pass in the form.This_Is_The_Field_I_Want variable into the CFC.
Again, am I missing something here and making myself into a retard?
.Peter J. Farrell
----------------------------------------------------------
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]
