home *** CD-ROM | disk | FTP | other *** search
- <CFSET RootPath = Reverse(Replace(Reverse(GetTemplatePath()),Reverse("admin\#GetFileFromPath(GetTemplatePath())#"),""))>
-
- <!---<CFIF FileExists(#RootPath#binarydata\--->
-
- <CFFILE ACTION="UPLOAD"
- FILEFIELD="UploadedFile"
- DESTINATION="#RootPath#binarydata"
- NAMECONFLICT="SKIP"
- ACCEPT="image/*, application/msword, application/pdf">
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-
- <HTML>
- <HEAD>
- <TITLE>Upload File</TITLE>
- </HEAD>
-
- <BODY BGCOLOR="#660000" TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#FFFF00">
-
- <P><IMG SRC="images/addcontent.gif" WIDTH=109 HEIGHT=20 BORDER=0 ALT="Add Content"></P>
-
- <CFIF File.FileExisted>
-
- <CFOUTPUT>
- <SCRIPT LANGUAGE="JAVASCRIPT">
- alert('The file "#File.ClientFile#"\nalready exists on the server.\n\nPlease rename your file and try again.');
- location.replace('#CGI.HTTP_REFERER#');
- </SCRIPT>
- The file #File.AttemptedServerFile# already exists on the server.<BR>
- Please rename your file and try again.
- </CFOUTPUT>
-
- <CFELSE>
-
- <CFTRANSACTION>
-
- <CFQUERY DATASOURCE="CFexamples" NAME="GetTopContentID">
- SELECT Max(ContentID) AS MaxID FROM PubContent
- </CFQUERY>
-
- <CFIF GetTopContentID.MaxID IS "">
- <CFSET NewContentID = 1>
- <CFELSE>
- <CFSET NewContentID = GetTopContentID.MaxID + 1>
- </CFIF>
-
- <CFQUERY DATASOURCE="CFexamples" NAME="InsertContent">
- INSERT INTO PubContent (ObjectID, TypeID, Data)
- VALUES (#ObjectID#, #TypeID#, '#File.ServerFile#')
- </CFQUERY>
-
- </CFTRANSACTION>
-
- <CFQUERY DATASOURCE="CFexamples" NAME="UpdateTime">
- UPDATE PubObjects SET DateUpdated = #Now()#
- WHERE ObjectID = #ObjectID#
- </CFQUERY>
-
- <CFLOCATION URL="properties.cfm?ObjectID=#ObjectID#">
-
- </CFIF>
-
- </BODY>
- </HTML>