annotate wiki/htdocs/applets/FCKeditor/editor/filemanager/connectors/cfm/cf_upload.cfm @ 3954:6089ade226fb

replace fckeditor with clean up version
author Byeongweon [tasyblue@gmail.com]
date Sat, 21 Jun 2008 17:38:55 +0900
parents
children 1d37117f8ca6
rev   line source
3954
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
1 <cfsetting enablecfoutputonly="yes" showdebugoutput="no">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
2 <!---
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
5 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
6 * == BEGIN LICENSE ==
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
7 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
8 * Licensed under the terms of any of the following licenses at your
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
9 * choice:
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
10 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
11 * - GNU General Public License Version 2 or later (the "GPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
12 * http://www.gnu.org/licenses/gpl.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
13 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
15 * http://www.gnu.org/licenses/lgpl.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
16 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
18 * http://www.mozilla.org/MPL/MPL-1.1.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
19 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
20 * == END LICENSE ==
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
21 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
22 * File Browser connector for ColdFusion (MX 6.0 and above).
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
23 * (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
24 --->
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
25
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
26 <cfparam name="url.type" default="File">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
27 <cfparam name="url.currentFolder" default="/">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
28
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
29 <!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
30
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
31 <cfinclude template="config.cfm">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
32 <cfinclude template="cf_util.cfm">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
33 <cfinclude template="cf_io.cfm">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
34 <cfinclude template="cf_commands.cfm">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
35
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
36 <cffunction name="SendError" returntype="void" output="true">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
37 <cfargument name="number" required="true" type="Numeric">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
38 <cfargument name="text" required="true">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
39 <cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "ARGUMENTS.text" )>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
40 </cffunction>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
41
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
42 <cfset REQUEST.Config = Config>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
43 <cfif find( "/", getBaseTemplatePath() ) >
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
44 <cfset REQUEST.Fs = "/">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
45 <cfelse>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
46 <cfset REQUEST.Fs = "\">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
47 </cfif>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
48
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
49 <cfif not Config.Enabled>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
50 <cfset SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
51 </cfif>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
52
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
53 <cfset sCommand = 'QuickUpload'>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
54 <cfset sType = "File">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
55
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
56 <cfif isDefined( "URL.Type" )>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
57 <cfset sType = URL.Type>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
58 </cfif>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
59
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
60 <cfset sCurrentFolder = GetCurrentFolder()>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
61
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
62 <!--- Is enabled the upload? --->
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
63 <cfif not IsAllowedCommand( sCommand )>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
64 <cfset SendUploadResults( "1", "", "", "The """ & sCommand & """ command isn't allowed" )>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
65 </cfif>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
66
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
67 <!--- Check if it is an allowed type. --->
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
68 <cfif not IsAllowedType( sType )>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
69 <cfset SendUploadResults( "1", "", "", "Invalid type specified" ) >
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
70 </cfif>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
71
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
72 <cfset FileUpload( sType, sCurrentFolder, sCommand )>