Well, we wouldn't want to be lazy now would we?? Thanks for th help. I'm at my day job now, but will try this when I get home tonight. I actually was thinking about how this would work in a dream last night. I think I need to back of the computer a bit.
On 3/29/07, Aaron DC <[EMAIL PROTECTED]> wrote:
Yeah that looks about right. Keep in mind that structures are passed by reference, so you can clobber values if you are not careful, but this is not usually a problem. The other way is to have the argument in the function default to "#form#", in which case you do not have to pass the form at all, but that's getting a little (too) lazy :-) <cfargument name="formStruct" default="#form#"> Aaron Ryan Everhart wrote: > Aaron, > Thanks for the quick reply. So if I were coding the call to the cfc > and I wanted to send the whole form to the cfc as a structure the call > might look like this? > > variables.fileSuccess = application.fileFunctions.uploadFile > (formStuct = form) > > Ryan > > variables.file > > On 3/29/07, *Aaron DC* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Hi Ryan > > the scopes such as FORM, URL, Session, Application, Client, etc, are > accessible globally. In other words, yes, you can upload a file > using a CFC. > > As a suggestion, I would pass the form structure or the specific form > field to your CFC and use that for the upload. You don't have to / > need > to, but it is slightly better practise. > > HTH > Aaron > > Ryan Everhart wrote: > > This may be a dumb question, but can you use a cfc to upload files? > > Do they have access to the form scope when executed? The way my > > application is being built is sorta like a framework where I have > > pages called views which display all my data then I have action > pages > > which do stuff like add/remove/update data in the db via > CFCs. So my > > question is, on an action page can I call a component that will be > > able to upload a picture from a form, or do i have to do the actual > > upload on the action page itself then do any other actions (rename, > > move, add file name to db) on the cfc. Thanks! I've been thinking > > about this all night but haven't tested it out yet. > > > > Ryan > > > > -- > > Ryan Everhart > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > > Blogging @ http://blog.ryaneverhart.com/ > > > > Have you gotten your InstantSpot yet? > > http://www.instantspot.com/referral?c=n3fpjscv > > You are subscribed to cfcdev. To unsubscribe, please follow the > > instructions at http://www.cfczone.org/listserv.cfm > > > > CFCDev is supported by: > > Katapult Media, Inc. > > We are cool code geeks looking for fun projects to rock! > > www.katapultmedia.com <http://www.katapultmedia.com> > > > > An archive of the CFCDev list is available at > > www.mail-archive.com/[email protected] > <http://www.mail-archive.com/[email protected]> > > > You are subscribed to cfcdev. To unsubscribe, please follow the > instructions at http://www.cfczone.org/listserv.cfm > > CFCDev is supported by: > Katapult Media, Inc. > We are cool code geeks looking for fun projects to rock! > www.katapultmedia.com <http://www.katapultmedia.com> > > An archive of the CFCDev list is available at > www.mail-archive.com/[email protected] > <http://www.mail-archive.com/[email protected]> > > > > > -- > Ryan Everhart > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > Blogging @ http://blog.ryaneverhart.com/ > > Have you gotten your InstantSpot yet? > http://www.instantspot.com/referral?c=n3fpjscv > You are subscribed to cfcdev. To unsubscribe, please follow the > instructions at http://www.cfczone.org/listserv.cfm > > CFCDev is supported by: > Katapult Media, Inc. > We are cool code geeks looking for fun projects to rock! > www.katapultmedia.com > > An archive of the CFCDev list is available at > www.mail-archive.com/[email protected] You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
-- Ryan Everhart [EMAIL PROTECTED] Blogging @ http://blog.ryaneverhart.com/ Have you gotten your InstantSpot yet? http://www.instantspot.com/referral?c=n3fpjscv You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
