Question : Coldfusion upload files problem

Hello experts.
I'm trying to upload files (application/msword, application/pdf, application/rtf, application/xls,
text/plain) with cffile and put the uploaded file name in db.I get this error:
Element SERVERFILE is undefined in CFFILE.
Any help?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
<cfparam name="SERVERFILE" default="">
<CFSET thispath = expandpath("../../artfiles")>  
<cfset file_uuid = createuuid()>  
<cfif len(trim(form.file))>
 <cftry>
      <cffile action="upload" filefield="form.file" destination="#thispath#" nameconflict="MAKEUNIQUE" result="upload"
                accept="application/msword, application/pdf, application/rtf, application/xls,
text/plain">
        <cfcatch type="any">
         <cfset   errors = ListAppend(errors,"¿p¿t¿ep¿µe¿a a¿¿e¿a :.pdf, .doc, .xls, .txt!")>
         </cfcatch>
        </cftry>
        <cfif errors EQ "">
        <CFSET ServerFile  = CFFILE.SERVERFILE>
        <cfquery name="imageupload" datasource="#request.dsn#">
            Insert into art_files (file_uuid,file_text,file_cat,file_title,fileSize,serverFileExt,file_datein)
            values (
            '#file_uuid#',
             '#ServerFile#',
            <cfif isNumeric(form.category)>
             <cfqueryparam cfsqltype="cf_sql_integer" value="#form.category#"><cfelse>NULL</cfif>,
		    <cfif len(trim(form.title))>
             <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.title)#"><cfelse>NULL</cfif>,
             <cfqueryparam cfsqltype="cf_sql_numeric" value="#file.filesize#">,
             <cfqueryparam cfsqltype="cf_sql_varchar" value="#file.serverfileext#">,
            <cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
            )
            </cfquery>
            <cfset inserted  = 1>
      </cfif></cfif>

Answer : Coldfusion upload files problem

That is a small tweak.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
Sub BKMCreatePerSection2()
    Dim rng As Range
    Dim Sec As Section
    Dim i As Integer
    Dim Suffix() As String
    Dim rngBookmark As Range
    
    Suffix = Split("DE,EN,ES,FR,IT", ",")
 
    For Each Sec In ActiveDocument.Sections
        Set rng = Sec.Range
        With rng.Find
            .Format = True
            .Style = ActiveDocument.Styles(wdStyleHeading2)
            Set rngBookmark = Sec.Range
            rngBookmark.MoveEnd wdCharacter, -1
            If .Execute Then
                ActiveDocument.Bookmarks.Add "Section_Bookmark_" & Suffix(i), rngBookmark
                i = i + 1
            End If
        End With
    Next Sec
        
End Sub
Random Solutions  
 
programming4us programming4us