I've noticed a strange problem when using cffile in a custom tag that I hope
someone might shed some light on. To help explain myself you can run the two
pages below, one is the custom tag strange.cfm, the other a form page.

Within strange.cfm CALLER.FileExisted exists without me setting it (the
cfparam and cfset are commented out at this point). Yet when I try and
reference VARIABLES.fileExisted in the calling page I get an error. Using
cfparam doesn't help, which I find strange, but cfset does what it should
do.

This was run on CFMX with no updaters and now at work with CFMX and updater
2.

Anyone have an explanation?

----------------------------------
        strange.cfm
----------------------------------
<!--- Upload the file to the current directory --->
<cffile action="upload" filefield="file" nameconflict="skip"
destination="#GetDirectoryFromPath(GetCurrentTemplatePath())#">

<!--- <cfparam name="CALLER.FileExisted" default="no"> --->
<!--- <cfset CALLER.FileExisted = "no"> --->

<p>
<cfoutput>
        Tag Debug<br>
        CFFILE.FileExisted = #CFFILE.FileExisted#<br>
        CALLER.FileExisted = #CALLER.FileExisted#<br>
</cfoutput>
<!--- CALLER:<cfdump var="#CALLER#"> --->
<!--- CFFILE:<cfdump var="#CFFILE#"> --->
</p>

----------------------------------
        test.cfm
----------------------------------
<html>
<head>
        <title>Test</title>
</head>

<body>

<cfif IsDefined("FORM.submit")>
        <cf_strange>
</cfif>

<form method="post" action="test.cfm" enctype="multipart/form-data">
        <input type="file" name="file">
        <input type="submit" name="submit" value="Submit">
</form>

<cfif IsDefined("FORM.submit")>
<p>
<cfoutput>
        Page Debug<br>
        CFFILE.FileExisted = #CFFILE.FileExisted#<br>
        VARIABLES.FileExisted = #VARIABLES.FileExisted#<br>
</cfoutput>
<!--- VARIABLES:<cfdump var="#VARIABLES#">
CFFILE:<cfdump var="#CFFILE#"> --->
</p>
</cfif>

</body>
</html>
----------------------------------
----------------------------------


Adrian Lynch
Web Developer
Thoughtbubble Ltd
----------------------
United Kingdom
http://www.thoughtbubble.net
Ph: +44 (0) 20 7387 8890
----------------------
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s) . Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0) 20 7387 8890


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to