<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>
|