You would also want to add the database record and then find your last
inserted recordID and update that record with the unique name uploaded in
the code below. You then use #SERVERFILE# for the name.
On 2/28/07, Peter Tilbrook wrote:
> <cffile action="UPLOAD" filefield="ImageFile"
> destination="#expandpath("images/content")#" nameconflict="MAKEUNIQUE">
>
> <cftry>
> <cffile action="UPLOAD" filefield="ImageFile"
> destination="#expandpath("images/content")#" nameconflict="MAKEUNIQUE">
> <cfcatch type="any">
> <cfinclude template="dsp_upload_error.cfm">
> <cfabort>
> </cfcatch>
> </cftry>
<cfquery datasource="#Datasource#">
UPDATE tbl_name
SET UploadFile =<cfqueryparam cfsqltype="cf_sql_varchar" maxlength="100"
value="#SERVERFILE#">
WHERE RecordID = <cfqueryparam cfsqltype="cf_sql_integer" maxlength="5"
value="#get.MAXID#">
</cfquery>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270935
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4