Hi,

I found out that the upload method of File 
(allaire\spectra\handlers\system\file\upload.cfm) does not change the File object it 
operates on. 
The properties "FileName", "FilePath", "FileURL" are not set. 

I checked up the Spectra Forum on Allaire site. 
(http://forums.allaire.com/spectraconf/Index.cfm?CFID=51168&CFTOKEN=56904825&&Message_ID=486870)
Seems there is a bug in Spectra, but the patch suggeested does not seem to work for me.

Thanks,
Bala

------------------------------------
<cfsetting enablecfoutputonly="yes">
<!--- 
        COAPI Object Handler (content object create initialization method)
        Object:                         file
        Method:                         upload
        Template:                       upload.cfm
        Author:                         Allen Manning
        Source Control:         $Header: /defender/handlers/system/file/upload.cfm 13  
  10/21/99 2:20p Amanning $
        Description:            file uploader
                                                mini-application that uploads a file 
to the given location
        Custom Attributes:      
                                                stParams.directoryPath (required)      
 -the directory to contain uploaded files.
                                                stParams.directoryURL (optional)       
 -the URL (excluding file name) of the directory 
                                                        that will allow you to access 
file from web server.
--->
<!--- include object type level settings --->
<cfinclude template="_settings.cfm">
<cfa_handler object="stFile">
        <cfa_controlHandler name="filepickeruploader" r_contextName="cn" 
r_stContextData="cd">
                <!--- VALIDATION --->
                <cfparam name="attributes.stParams.directoryURL" default="">
                <!--- validate directory path --->
                <cfparam name="attributes.stParams.directoryPath">
                <!--- check to see if directory path is well formed --->
                <cfif ((not directoryExists(attributes.stParams.directoryPath)) or 
(right(attributes.stParams.directoryPath,1) neq "/") and 
right(attributes.stParams.directoryPath,1) neq "\")>                
                        <cfscript>
                                stDetail = structNew();
                                stDetail.directoryPath = 
attributes.stParams.directoryPath;
                                stDetail.currentTemplate = getCurrentTemplatePath();
                        </cfscript>
                        <!--- throw exception --->      
                        <cfa_throw
                                stErrorData="#stDetail#"
                                errorcode="dirdoesnotexist">    
                        <cfexit method="exittag">
                </cfif>
<!--- !FileUploaded --->                
                <cfa_controlHandlerEvent name="fileuploaded">
                        <cfif len(uploadfile)>
                                <!--- upload file --->
                                <cffile 
                destination="#attributes.stParams.directoryPath#" 
                                        action="upload" 
                                        nameconflict="makeunique" 
                                        filefield="uploadfile" 
                                        mode="777">
                <!--- update object information --->
                 <cfa_contentObjectData
                dataSource = "#request.cfa.objectstore.dsn#"
                                objectID = "#stFile.objectID#"
                         >
                                <!--- update the following properties --->
                                <CFA_ContentObjectProperty name="filePath" 
value="#attributes.stParams.directoryPath##file.ClientFile#">
                                <CFA_ContentObjectProperty name="fileName" 
value="#file.ClientFile#">
                                <CFA_ContentObjectProperty name="fileURL" 
value="#attributes.stParams.directoryURL##file.ClientFile#">
                        </cfa_contentObjectData>
                                
                                <cfif not file.filewassaved>
                                        <cfscript>
                                                stDetail = structNew();
        stDetail.currentTemplate = getCurrentTemplatePath();
                                        </cfscript>
                                        <!--- throw exception --->                     
                 <cfa_throw
                                        stErrorData="#stDetail#"
        errorcode="fileuploadfailure">  
                                </cfif>
                        </cfif>
                </cfa_controlHandlerEvent>
                <!--- render uploading form --->
                <cfoutput>
                        <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                                <td>
                                        <input name="uploadfile" type="file" size="15" 
style="height:19;">
                                </td>
                                <td width="5">&nbsp;</td>
                                <td>
                                        <cfa_linkButton
                                                dataSource = "#attributes.dataSource#"
                                                id = 
"D3E48F89-FE2A-11D2-B6300060B0EB4464"
                                                label = "Upload"
        action="controlHandlerEvent"
        actionData="#cn#.fileuploaded"
description="Upload the selected file to the server's media directory."
                                                state="normal">
                                </td>
                        </tr>
                        </table>
                </cfoutput>
        </cfa_controlHandler>
</cfa_handler>
<cfsetting enablecfoutputonly="no">


Send your favorite photo with any online greeting!
http://www.whowhere.lycos.com/redirects/americangreetings.rdct
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to